< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Protocol.Validators.TxRemoveOutputValidator
Assembly: NLightning.Infrastructure
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure/Protocol/Validators/TxRemoveOutputValidator.cs
Tag: 30_15166811759
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 19
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Validate(...)0%4260%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure/Protocol/Validators/TxRemoveOutputValidator.cs

#LineLine coverage
 1namespace NLightning.Infrastructure.Protocol.Validators;
 2
 3using Domain.Protocol.Payloads;
 4
 5public static class TxRemoveOutputValidator
 6{
 7    public static void Validate(bool isInitiator, TxRemoveOutputPayload output, Func<ulong, bool> isSerialIdPresent)
 8    {
 09        if (isInitiator && (output.SerialId & 1) != 0) // Ensure even serial_id for initiator
 10        {
 011            throw new InvalidOperationException("SerialId has the wrong parity.");
 12        }
 13
 014        if (!isSerialIdPresent(output.SerialId))
 15        {
 016            throw new InvalidOperationException("The serial_id does not correspond to a currently added output.");
 17        }
 018    }
 19}