< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Payloads.OpenChannel2Payload
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/OpenChannel2Payload.cs
Tag: 36_15743069263
Line coverage
100%
Covered lines: 39
Uncovered lines: 0
Coverable lines: 39
Total lines: 137
Line coverage: 100%
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
.ctor(...)100%11100%
get_ChainHash()100%11100%
get_ChannelId()100%11100%
get_FundingFeeRatePerKw()100%11100%
get_CommitmentFeeRatePerKw()100%11100%
get_FundingAmount()100%11100%
get_DustLimitAmount()100%11100%
get_MaxHtlcValueInFlightAmount()100%11100%
get_HtlcMinimumAmount()100%11100%
get_ToSelfDelay()100%11100%
get_MaxAcceptedHtlcs()100%11100%
get_Locktime()100%11100%
get_FundingPubKey()100%11100%
get_RevocationBasepoint()100%11100%
get_PaymentBasepoint()100%11100%
get_DelayedPaymentBasepoint()100%11100%
get_HtlcBasepoint()100%11100%
get_FirstPerCommitmentPoint()100%11100%
get_SecondPerCommitmentPoint()100%11100%
get_ChannelFlags()100%11100%

File(s)

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

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Payloads;
 2
 3using Channels.ValueObjects;
 4using Crypto.ValueObjects;
 5using Interfaces;
 6using Money;
 7using ValueObjects;
 8
 9/// <summary>
 10/// Represents the payload for the open_channel2 message.
 11/// </summary>
 12/// <remarks>
 13/// Initializes a new instance of the OpenChannel2Payload class.
 14/// </remarks>
 2015public class OpenChannel2Payload(
 2016    ChainHash chainHash,
 2017    ChannelFlags channelFlags,
 2018    uint commitmentFeeRatePerKw,
 2019    CompactPubKey delayedPaymentBasepoint,
 2020    LightningMoney dustLimitAmount,
 2021    CompactPubKey firstPerCommitmentPoint,
 2022    ulong fundingAmount,
 2023    uint fundingFeeRatePerKw,
 2024    CompactPubKey fundingPubKey,
 2025    CompactPubKey htlcBasepoint,
 2026    LightningMoney htlcMinimumAmount,
 2027    uint locktime,
 2028    ushort maxAcceptedHtlcs,
 2029    LightningMoney maxHtlcValueInFlight,
 2030    CompactPubKey paymentBasepoint,
 2031    CompactPubKey revocationBasepoint,
 2032    CompactPubKey secondPerCommitmentPoint,
 2033    ushort toSelfDelay,
 2034    ChannelId channelId) : IChannelMessagePayload
 35{
 36    /// <summary>
 37    /// The chain_hash value denotes the exact blockchain that the opened channel will reside within.
 38    /// </summary>
 3639    public ChainHash ChainHash { get; } = chainHash;
 40
 41    /// <summary>
 42    /// The temporary_channel_id is used to identify this channel on a per-peer basis until the funding transaction
 43    /// is established, at which point it is replaced by the channel_id, which is derived from the funding transaction.
 44    /// </summary>
 3645    public ChannelId ChannelId { get; } = channelId;
 46
 47    /// <summary>
 48    /// funding_feerate_perkw indicates the fee rate that the opening node will pay for the funding transaction in
 49    /// satoshi per 1000-weight, as described in BOLT-3, Appendix F
 50    /// </summary>
 3651    public uint FundingFeeRatePerKw { get; } = fundingFeeRatePerKw;
 52
 53    /// <summary>
 54    /// commitment_feerate_perkw indicates the fee rate that will be paid for the commitment transaction in
 55    /// satoshi per 1000-weight, as described in BOLT-3, Appendix F
 56    /// </summary>
 3657    public uint CommitmentFeeRatePerKw { get; } = commitmentFeeRatePerKw;
 58
 59    /// <summary>
 60    /// funding_satoshis is the amount the sender is putting into the channel.
 61    /// </summary>
 3662    public LightningMoney FundingAmount { get; } = fundingAmount;
 63
 64    /// <summary>
 65    /// dust_limit_satoshis is the threshold below which outputs should not be generated for this node's commitment or
 66    /// HTLC transactions
 67    /// </summary>
 3668    public LightningMoney DustLimitAmount { get; } = dustLimitAmount;
 69
 70    /// <summary>
 71    /// max_htlc_value_in_flight_msat is a cap on total value of outstanding HTLCs offered by the remote node, which
 72    /// allows the local node to limit its exposure to HTLCs
 73    /// </summary>
 3674    public LightningMoney MaxHtlcValueInFlightAmount { get; } = maxHtlcValueInFlight;
 75
 76    /// <summary>
 77    /// htlc_minimum_msat indicates the smallest value HTLC this node will accept.
 78    /// </summary>
 3679    public LightningMoney HtlcMinimumAmount { get; } = htlcMinimumAmount;
 80
 81    /// <summary>
 82    /// to_self_delay is how long (in blocks) the other node will have to wait in case of breakdown before redeeming
 83    /// its own funds.
 84    /// </summary>
 3685    public ushort ToSelfDelay { get; } = toSelfDelay;
 86
 87    /// <summary>
 88    /// max_accepted_htlcs limits the number of outstanding HTLCs the remote node can offer.
 89    /// </summary>
 3690    public ushort MaxAcceptedHtlcs { get; } = maxAcceptedHtlcs;
 91
 92    /// <summary>
 93    /// locktime is the locktime for the funding transaction.
 94    /// </summary>
 3695    public uint Locktime { get; } = locktime;
 96
 97    /// <summary>
 98    /// funding_pubkey is the public key in the 2-of-2 multisig script of the funding transaction output.
 99    /// </summary>
 36100    public CompactPubKey FundingPubKey { get; } = fundingPubKey;
 101
 102    /// <summary>
 103    /// revocation_basepoint is used to regenerate the scripts required for the penalty transaction
 104    /// </summary>
 36105    public CompactPubKey RevocationBasepoint { get; } = revocationBasepoint;
 106
 107    /// <summary>
 108    /// payment_basepoint is used to produce payment signatures for the protocol
 109    /// </summary>
 36110    public CompactPubKey PaymentBasepoint { get; } = paymentBasepoint;
 111
 112    /// <summary>
 113    /// delayed_payment_basepoint is used to regenerate the scripts required for the penalty transaction
 114    /// </summary>
 36115    public CompactPubKey DelayedPaymentBasepoint { get; } = delayedPaymentBasepoint;
 116
 117    /// <summary>
 118    /// htlc_basepoint is used to produce HTLC signatures for the protocol
 119    /// </summary>
 36120    public CompactPubKey HtlcBasepoint { get; } = htlcBasepoint;
 121
 122    /// <summary>
 123    /// first_per_commitment_point is the per-commitment point used for the first commitment transaction
 124    /// </summary>
 36125    public CompactPubKey FirstPerCommitmentPoint { get; } = firstPerCommitmentPoint;
 126
 127    /// <summary>
 128    /// second_per_commitment_point is the per-commitment point used for the first commitment transaction
 129    /// </summary>
 36130    public CompactPubKey SecondPerCommitmentPoint { get; } = secondPerCommitmentPoint;
 131
 132    /// <summary>
 133    /// Only the least-significant bit of channel_flags is currently defined: announce_channel. This indicates whether
 134    /// the initiator of the funding flow wishes to advertise this channel publicly to the network
 135    /// </summary>
 36136    public ChannelFlags ChannelFlags { get; } = channelFlags;
 137}