< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Bitcoin.DependencyInjection
Assembly: NLightning.Infrastructure.Bitcoin
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Bitcoin/DependencyInjection.cs
Tag: 36_15743069263
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 39
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddBitcoinInfrastructure(...)100%210%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Bitcoin/DependencyInjection.cs

#LineLine coverage
 1using Microsoft.Extensions.DependencyInjection;
 2using NLightning.Infrastructure.Bitcoin.Builders.Interfaces;
 3using NLightning.Infrastructure.Bitcoin.Wallet;
 4using NLightning.Infrastructure.Bitcoin.Wallet.Interfaces;
 5
 6namespace NLightning.Infrastructure.Bitcoin;
 7
 8using Builders;
 9using Crypto.Functions;
 10using Domain.Protocol.Interfaces;
 11using Infrastructure.Crypto.Interfaces;
 12using Protocol.Factories;
 13using Services;
 14
 15/// <summary>
 16/// Extension methods for setting up Bitcoin infrastructure services in an IServiceCollection.
 17/// </summary>
 18public static class DependencyInjection
 19{
 20    /// <summary>
 21    /// Adds Bitcoin infrastructure services to the specified IServiceCollection.
 22    /// </summary>
 23    /// <param name="services">The IServiceCollection to add services to.</param>
 24    /// <returns>The same service collection so that multiple calls can be chained.</returns>
 25    public static IServiceCollection AddBitcoinInfrastructure(this IServiceCollection services)
 26    {
 27        // Register Singletons
 028        services.AddSingleton<IBitcoinWallet, BitcoinWalletService>();
 029        services.AddSingleton<IBlockchainMonitor, BlockchainMonitorService>();
 030        services.AddSingleton<ICommitmentKeyDerivationService, CommitmentKeyDerivationService>();
 031        services.AddSingleton<ICommitmentTransactionBuilder, CommitmentTransactionBuilder>();
 032        services.AddSingleton<IEcdh, Ecdh>();
 033        services.AddSingleton<IFundingOutputBuilder, FundingOutputBuilder>();
 034        services.AddSingleton<IKeyDerivationService, KeyDerivationService>();
 035        services.AddSingleton<ITlvConverterFactory, TlvConverterFactory>();
 36
 037        return services;
 38    }
 39}