< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Payloads.TxAddInputPayload
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/TxAddInputPayload.cs
Tag: 30_15166811759
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 65
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ChannelId()100%11100%
get_SerialId()100%11100%
get_PrevTx()100%11100%
get_PrevTxVout()100%11100%
get_Sequence()100%11100%
.ctor(...)50%22100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/TxAddInputPayload.cs

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Payloads;
 2
 3using Constants;
 4using Interfaces;
 5using Messages;
 6using ValueObjects;
 7
 8/// <summary>
 9/// Represents a tx_add_input payload.
 10/// </summary>
 11/// <remarks>
 12/// The tx_add_input payload is used to add an input to the transaction.
 13/// </remarks>
 14/// <seealso cref="TxAddInputMessage"/>
 15/// <seealso cref="ValueObjects.ChannelId"/>
 16public class TxAddInputPayload : IMessagePayload
 17{
 18    /// <summary>
 19    /// The channel id.
 20    /// </summary>
 821    public ChannelId ChannelId { get; }
 22
 23    /// <summary>
 24    /// The serial id.
 25    /// </summary>
 826    public ulong SerialId { get; }
 27
 28    /// <summary>
 29    /// The previous transaction id.
 30    /// </summary>
 1231    public byte[] PrevTx { get; }
 32
 33    /// <summary>
 34    /// The previous transaction vout.
 35    /// </summary>
 836    public uint PrevTxVout { get; }
 37
 38    /// <summary>
 39    /// The sequence.
 40    /// </summary>
 841    public uint Sequence { get; }
 42
 43    /// <summary>
 44    /// Initializes a new instance of the TxAddInputPayload class.
 45    /// </summary>
 46    /// <param name="channelId">The channel id.</param>
 47    /// <param name="serialId">The serial id.</param>
 48    /// <param name="prevTx">The previous transaction id.</param>
 49    /// <param name="prevTxVout">The previous transaction vout.</param>
 50    /// <param name="sequence">The sequence.</param>
 51    /// <exception cref="ArgumentException">Sequence is out of bounds.</exception>
 1252    public TxAddInputPayload(ChannelId channelId, ulong serialId, byte[] prevTx, uint prevTxVout, uint sequence)
 53    {
 1254        if (sequence > InteractiveTransactionConstants.MAX_SEQUENCE)
 55        {
 456            throw new ArgumentException($"Sequence must be less than or equal to {InteractiveTransactionConstants.MAX_SE
 57        }
 58
 859        ChannelId = channelId;
 860        SerialId = serialId;
 861        PrevTx = prevTx;
 862        PrevTxVout = prevTxVout;
 863        Sequence = sequence;
 864    }
 65}