< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Bitcoin.Transactions.Outputs.HtlcOutputInfo
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Bitcoin/Transactions/Outputs/HtlcOutputInfo.cs
Tag: 36_15743069263
Line coverage
84%
Covered lines: 16
Uncovered lines: 3
Coverable lines: 19
Total lines: 78
Line coverage: 84.2%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Amount()100%11100%
get_OutputType()100%210%
get_Htlc()100%11100%
get_PaymentHash()100%11100%
get_CltvExpiry()100%11100%
get_RevocationPubKey()100%11100%
get_LocalHtlcPubKey()100%11100%
get_RemoteHtlcPubKey()100%11100%
get_TransactionId()100%210%
get_Index()100%210%
.ctor(...)100%22100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Bitcoin/Transactions/Outputs/HtlcOutputInfo.cs

#LineLine coverage
 1using NLightning.Domain.Bitcoin.Transactions.Enums;
 2using NLightning.Domain.Bitcoin.Transactions.Interfaces;
 3using NLightning.Domain.Bitcoin.ValueObjects;
 4using NLightning.Domain.Channels.ValueObjects;
 5using NLightning.Domain.Crypto.ValueObjects;
 6using NLightning.Domain.Money;
 7
 8namespace NLightning.Domain.Bitcoin.Transactions.Outputs;
 9
 10/// <summary>
 11/// Base class for HTLC output information.
 12/// </summary>
 13public abstract class HtlcOutputInfo : IOutputInfo
 14{
 15    /// <summary>
 16    /// Gets the amount of the output.
 17    /// </summary>
 13218    public LightningMoney Amount { get; }
 19
 20    /// <summary>
 21    /// Gets the type of the output.
 22    /// </summary>
 023    public OutputType OutputType { get; }
 24
 25    /// <summary>
 26    /// Gets the HTLC this output is based on.
 27    /// </summary>
 26428    public Htlc Htlc { get; }
 29
 30    /// <summary>
 31    /// Gets the payment hash for this HTLC.
 32    /// </summary>
 13233    public Hash PaymentHash => Htlc.PaymentHash;
 34
 35    /// <summary>
 36    /// Gets the CLTV expiry for this HTLC.
 37    /// </summary>
 13238    public uint CltvExpiry => Htlc.CltvExpiry;
 39
 40    /// <summary>
 41    /// Gets the revocation public key.
 42    /// </summary>
 13243    public CompactPubKey RevocationPubKey { get; }
 44
 45    /// <summary>
 46    /// Gets the local HTLC public key.
 47    /// </summary>
 13248    public CompactPubKey LocalHtlcPubKey { get; }
 49
 50    /// <summary>
 51    /// Gets the remote HTLC public key.
 52    /// </summary>
 13253    public CompactPubKey RemoteHtlcPubKey { get; }
 54
 55    /// <summary>
 56    /// Gets or sets the transaction ID of the output once it's created.
 57    /// </summary>
 058    public TxId? TransactionId { get; set; }
 59
 60    /// <summary>
 61    /// Gets or sets the index of the output in the transaction once it's created.
 62    /// </summary>
 063    public ushort? Index { get; set; }
 64
 65    /// <summary>
 66    /// Creates a new instance of HtlcOutputInfo.
 67    /// </summary>
 13268    protected HtlcOutputInfo(Htlc htlc, CompactPubKey localHtlcPubKey, CompactPubKey remoteHtlcPubKey,
 13269                             CompactPubKey revocationPubKey, bool isOffered)
 70    {
 13271        Htlc = htlc;
 13272        Amount = htlc.Amount;
 13273        RevocationPubKey = revocationPubKey;
 13274        LocalHtlcPubKey = localHtlcPubKey;
 13275        RemoteHtlcPubKey = remoteHtlcPubKey;
 13276        OutputType = isOffered ? OutputType.OfferedHtlc : OutputType.ReceivedHtlc;
 13277    }
 78}