< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Protocol.Validators.TxCompleteValidator
Assembly: NLightning.Infrastructure
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure/Protocol/Validators/TxCompleteValidator.cs
Tag: 30_15166811759
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 35
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
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%110100%

File(s)

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

#LineLine coverage
 1namespace NLightning.Infrastructure.Protocol.Validators;
 2
 3using Domain.Protocol.Constants;
 4
 5public static class TxCompleteValidator
 6{
 7    public static void Validate(ulong peerInputSatoshis, ulong peerOutputSatoshis, ulong peerFundingOutput, ulong agreed
 8                                ulong peerPaidFeerate, int currentInputCount, int currentOutputCount, ulong estimatedTxW
 9    {
 010        if (peerInputSatoshis < peerOutputSatoshis + peerFundingOutput)
 11        {
 012            throw new InvalidOperationException("The peer's total input satoshis is less than their outputs.");
 13        }
 14
 015        if (peerPaidFeerate < agreedFeerate)
 16        {
 017            throw new InvalidOperationException("The peer's paid feerate does not meet or exceed the agreed feerate.");
 18        }
 19
 020        if (currentInputCount > InteractiveTransactionConstants.MAX_INPUTS_ALLOWED)
 21        {
 022            throw new InvalidOperationException($"There are more than {InteractiveTransactionConstants.MAX_INPUTS_ALLOWE
 23        }
 24
 025        if (currentOutputCount > InteractiveTransactionConstants.MAX_OUTPUTS_ALLOWED)
 26        {
 027            throw new InvalidOperationException($"There are more than {InteractiveTransactionConstants.MAX_OUTPUTS_ALLOW
 28        }
 29
 030        if (estimatedTxWeight > InteractiveTransactionConstants.MAX_STANDARD_TX_WEIGHT)
 31        {
 032            throw new InvalidOperationException($"The estimated weight of the transaction is greater than {InteractiveTr
 33        }
 034    }
 35}