< 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: 30_15166811759
Line coverage
0%
Covered lines: 0
Uncovered lines: 20
Coverable lines: 20
Total lines: 37
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(PubKey revocationPubKey, PubKey localDelayedPubKey, ulong toSelfDelay, LightningMoney am
 016        : base(GenerateHtlcOutputScript(revocationPubKey, localDelayedPubKey, toSelfDelay), amount)
 17    {
 018        RevocationPubKey = revocationPubKey;
 019        LocalDelayedPubKey = localDelayedPubKey;
 020        ToSelfDelay = toSelfDelay;
 021    }
 22
 23    private static Script GenerateHtlcOutputScript(PubKey revocationPubKey, PubKey localDelayedPubKey, ulong toSelfDelay
 24    {
 025        return new Script(
 026            OpcodeType.OP_IF,
 027            Op.GetPushOp(revocationPubKey.ToBytes()),
 028            OpcodeType.OP_ELSE,
 029            Op.GetPushOp((long)toSelfDelay),
 030            OpcodeType.OP_CHECKSEQUENCEVERIFY,
 031            OpcodeType.OP_DROP,
 032            Op.GetPushOp(localDelayedPubKey.ToBytes()),
 033            OpcodeType.OP_ENDIF,
 034            OpcodeType.OP_CHECKSIG
 035        );
 36    }
 37}