< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Bitcoin.Outputs.HtlcResolutionOutput
Assembly: NLightning.Infrastructure.Bitcoin
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Bitcoin/Outputs/HtlcResolutionOutput.cs
Tag: 36_15743069263
Line coverage
0%
Covered lines: 0
Uncovered lines: 20
Coverable lines: 20
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
get_ScriptType()100%210%
get_RevocationPubKey()100%210%
get_LocalDelayedPubKey()100%210%
get_ToSelfDelay()100%210%
.ctor(...)100%210%
GenerateHtlcOutputScript(...)100%210%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Bitcoin/Outputs/HtlcResolutionOutput.cs

#LineLine coverage
 1using NBitcoin;
 2
 3namespace NLightning.Infrastructure.Bitcoin.Outputs;
 4
 5using Domain.Money;
 6
 7public class HtlcResolutionOutput : BaseOutput
 8{
 09    public override ScriptType ScriptType => ScriptType.P2WSH;
 10
 011    public PubKey RevocationPubKey { get; }
 012    public PubKey LocalDelayedPubKey { get; }
 013    public ulong ToSelfDelay { get; }
 14
 15    public HtlcResolutionOutput(LightningMoney amount, PubKey localDelayedPubKey, PubKey revocationPubKey,
 16                                ulong toSelfDelay)
 017        : base(amount, GenerateHtlcOutputScript(revocationPubKey, localDelayedPubKey, toSelfDelay))
 18    {
 019        RevocationPubKey = revocationPubKey;
 020        LocalDelayedPubKey = localDelayedPubKey;
 021        ToSelfDelay = toSelfDelay;
 022    }
 23
 24    private static Script GenerateHtlcOutputScript(PubKey localDelayedPubKey, PubKey revocationPubKey,
 25                                                   ulong toSelfDelay)
 26    {
 027        return new Script(
 028            OpcodeType.OP_IF,
 029            Op.GetPushOp(revocationPubKey.ToBytes()),
 030            OpcodeType.OP_ELSE,
 031            Op.GetPushOp((long)toSelfDelay),
 032            OpcodeType.OP_CHECKSEQUENCEVERIFY,
 033            OpcodeType.OP_DROP,
 034            Op.GetPushOp(localDelayedPubKey.ToBytes()),
 035            OpcodeType.OP_ENDIF,
 036            OpcodeType.OP_CHECKSIG
 037        );
 38    }
 39}