< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Payloads.AcceptChannel1Payload
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/AcceptChannel1Payload.cs
Tag: 36_15743069263
Line coverage
85%
Covered lines: 30
Uncovered lines: 5
Coverable lines: 35
Total lines: 114
Line coverage: 85.7%
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_ChannelId()100%11100%
get_DustLimitAmount()100%210%
get_MaxHtlcValueInFlightAmount()100%210%
get_ChannelReserveAmount()100%11100%
get_HtlcMinimumAmount()100%210%
get_MinimumDepth()100%11100%
get_ToSelfDelay()100%210%
get_MaxAcceptedHtlcs()100%210%
get_FundingPubKey()100%11100%
get_RevocationBasepoint()100%11100%
get_PaymentBasepoint()100%11100%
get_DelayedPaymentBasepoint()100%11100%
get_HtlcBasepoint()100%11100%
get_FirstPerCommitmentPoint()100%11100%
.ctor(...)100%11100%

File(s)

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

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Payloads;
 2
 3using Domain.Channels.ValueObjects;
 4using Domain.Crypto.ValueObjects;
 5using Interfaces;
 6using Money;
 7
 8/// <summary>
 9/// Represents the payload for the accept_channel message.
 10/// </summary>
 11/// <remarks>
 12/// Initializes a new instance of the AcceptChannel1Payload class.
 13/// </remarks>
 14public class AcceptChannel1Payload : IChannelMessagePayload
 15{
 16    /// <summary>
 17    /// The temporary_channel_id is used to identify this channel on a per-peer basis until the funding transaction
 18    /// is established, at which point it is replaced by the channel_id, which is derived from the funding transaction.
 19    /// </summary>
 2020    public ChannelId ChannelId { get; set; }
 21
 22    /// <summary>
 23    /// dust_limit_satoshis is the threshold below which outputs should not be generated for this node's commitment or
 24    /// HTLC transactions
 25    /// </summary>
 026    public LightningMoney DustLimitAmount { get; }
 27
 28    /// <summary>
 29    /// max_htlc_value_in_flight_msat is a cap on total value of outstanding HTLCs offered by the remote node, which
 30    /// allows the local node to limit its exposure to HTLCs
 31    /// </summary>
 032    public LightningMoney MaxHtlcValueInFlightAmount { get; }
 33
 34    /// <summary>
 35    /// channel_reserve_satoshis is the amount the acceptor is reserving for the channel, which is not available for
 36    /// spending
 37    /// </summary>
 2038    public LightningMoney ChannelReserveAmount { get; set; }
 39
 40    /// <summary>
 41    /// htlc_minimum_msat indicates the smallest value HTLC this node will accept.
 42    /// </summary>
 043    public LightningMoney HtlcMinimumAmount { get; }
 44
 45    /// <summary>
 46    /// minimum_depth is the number of blocks we consider reasonable to avoid double-spending of the funding transaction
 47    /// In case channel_type includes option_zeroconf this MUST be 0
 48    /// </summary>
 2049    public uint MinimumDepth { get; set; }
 50
 51    /// <summary>
 52    /// to_self_delay is how long (in blocks) the other node will have to wait in case of breakdown before redeeming
 53    /// its own funds.
 54    /// </summary>
 055    public ushort ToSelfDelay { get; }
 56
 57    /// <summary>
 58    /// max_accepted_htlcs limits the number of outstanding HTLCs the remote node can offer.
 59    /// </summary>
 060    public ushort MaxAcceptedHtlcs { get; }
 61
 62    /// <summary>
 63    /// funding_pubkey is the public key in the 2-of-2 multisig script of the funding transaction output.
 64    /// </summary>
 2065    public CompactPubKey FundingPubKey { get; set; }
 66
 67    /// <summary>
 68    /// revocation_basepoint is used to regenerate the scripts required for the penalty transaction
 69    /// </summary>
 2070    public CompactPubKey RevocationBasepoint { get; set; }
 71
 72    /// <summary>
 73    /// payment_basepoint is used to produce payment signatures for the protocol
 74    /// </summary>
 2075    public CompactPubKey PaymentBasepoint { get; set; }
 76
 77    /// <summary>
 78    /// delayed_payment_basepoint is used to regenerate the scripts required for the penalty transaction
 79    /// </summary>
 2080    public CompactPubKey DelayedPaymentBasepoint { get; set; }
 81
 82    /// <summary>
 83    /// htlc_basepoint is used to produce HTLC signatures for the protocol
 84    /// </summary>
 2085    public CompactPubKey HtlcBasepoint { get; set; }
 86
 87    /// <summary>
 88    /// first_per_commitment_point is the per-commitment point used for the first commitment transaction
 89    /// </summary>
 2090    public CompactPubKey FirstPerCommitmentPoint { get; set; }
 91
 2092    public AcceptChannel1Payload(ChannelId channelId, LightningMoney channelReserveAmount,
 2093                                 CompactPubKey delayedPaymentBasepoint, LightningMoney dustLimitAmount,
 2094                                 CompactPubKey firstPerCommitmentPoint, CompactPubKey fundingPubKey,
 2095                                 CompactPubKey htlcBasepoint, LightningMoney htlcMinimumAmount, ushort maxAcceptedHtlcs,
 2096                                 LightningMoney maxHtlcValueInFlight, uint minimumDepth, CompactPubKey paymentBasepoint,
 2097                                 CompactPubKey revocationBasepoint, ushort toSelfDelay)
 98    {
 2099        ChannelId = channelId;
 20100        DustLimitAmount = dustLimitAmount;
 20101        MaxHtlcValueInFlightAmount = maxHtlcValueInFlight;
 20102        ChannelReserveAmount = channelReserveAmount;
 20103        HtlcMinimumAmount = htlcMinimumAmount;
 20104        MinimumDepth = minimumDepth;
 20105        ToSelfDelay = toSelfDelay;
 20106        MaxAcceptedHtlcs = maxAcceptedHtlcs;
 20107        FundingPubKey = fundingPubKey;
 20108        RevocationBasepoint = revocationBasepoint;
 20109        PaymentBasepoint = paymentBasepoint;
 20110        DelayedPaymentBasepoint = delayedPaymentBasepoint;
 20111        HtlcBasepoint = htlcBasepoint;
 20112        FirstPerCommitmentPoint = firstPerCommitmentPoint;
 20113    }
 114}