< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Bitcoin.Transactions.HtlcSuccessTransaction
Assembly: NLightning.Infrastructure.Bitcoin
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Bitcoin/Transactions/HtlcSuccessTransaction.cs
Tag: 30_15166811759
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 31
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
get_PaymentPreimage()100%210%
.ctor(...)100%210%
SignTransaction(...)100%210%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Bitcoin/Transactions/HtlcSuccessTransaction.cs

#LineLine coverage
 1using NBitcoin;
 2
 3namespace NLightning.Infrastructure.Bitcoin.Transactions;
 4
 5using Outputs;
 6
 7public class HtlcSuccessTransaction : BaseHtlcTransaction
 8{
 09    public byte[] PaymentPreimage { get; }
 10
 11    public HtlcSuccessTransaction(Network network, bool hasAnchorOutputs, BaseHtlcOutput output,
 12                                  PubKey revocationPubKey, PubKey localDelayedPubKey, ulong toSelfDelay,
 13                                  ulong amountMilliSats, byte[] paymentPreimage)
 014        : base(hasAnchorOutputs, network, output, revocationPubKey, localDelayedPubKey, toSelfDelay, amountMilliSats)
 15    {
 016        SetLockTime(0);
 017        PaymentPreimage = paymentPreimage;
 018    }
 19
 20    protected new void SignTransaction(params BitcoinSecret[] secrets)
 21    {
 022        var witness = new WitScript(
 023            Op.GetPushOp(0), // OP_0
 024            Op.GetPushOp(0), // Remote signature
 025            Op.GetPushOp(0), // Local signature
 026            Op.GetPushOp(PaymentPreimage) // Payment pre-image for HTLC-success
 027        );
 28
 029        base.SignTransaction(secrets);
 030    }
 31}