< 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: 30_15166811759
Line coverage
100%
Covered lines: 26
Uncovered lines: 0
Coverable lines: 26
Total lines: 124
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

File(s)

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

#LineLine coverage
 1using NBitcoin;
 2
 3namespace NLightning.Domain.Protocol.Payloads;
 4
 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(ChainHash chainHash, ChannelFlags channelFlags, uint commitmentFeeRatePerKw,
 2016                                 PubKey delayedPaymentBasepoint, LightningMoney dustLimitAmount,
 2017                                 PubKey firstPerCommitmentPoint, ulong fundingAmount, uint fundingFeeRatePerKw,
 2018                                 PubKey fundingPubKey, PubKey htlcBasepoint, LightningMoney htlcMinimumAmount,
 2019                                 uint locktime, ushort maxAcceptedHtlcs, LightningMoney maxHtlcValueInFlight,
 2020                                 PubKey paymentBasepoint, PubKey revocationBasepoint, PubKey secondPerCommitmentPoint,
 2021                                 ushort toSelfDelay, ChannelId temporaryChannelId) : IMessagePayload
 22{
 23    /// <summary>
 24    /// The chain_hash value denotes the exact blockchain that the opened channel will reside within.
 25    /// </summary>
 3626    public ChainHash ChainHash { get; } = chainHash;
 27
 28    /// <summary>
 29    /// The temporary_channel_id is used to identify this channel on a per-peer basis until the funding transaction
 30    /// is established, at which point it is replaced by the channel_id, which is derived from the funding transaction.
 31    /// </summary>
 3632    public ChannelId TemporaryChannelId { get; } = temporaryChannelId;
 33
 34    /// <summary>
 35    /// funding_feerate_perkw indicates the fee rate that the opening node will pay for the funding transaction in
 36    /// satoshi per 1000-weight, as described in BOLT-3, Appendix F
 37    /// </summary>
 3638    public uint FundingFeeRatePerKw { get; } = fundingFeeRatePerKw;
 39
 40    /// <summary>
 41    /// commitment_feerate_perkw indicates the fee rate that will be paid for the commitment transaction in
 42    /// satoshi per 1000-weight, as described in BOLT-3, Appendix F
 43    /// </summary>
 3644    public uint CommitmentFeeRatePerKw { get; } = commitmentFeeRatePerKw;
 45
 46    /// <summary>
 47    /// funding_satoshis is the amount the sender is putting into the channel.
 48    /// </summary>
 3649    public LightningMoney FundingAmount { get; } = fundingAmount;
 50
 51    /// <summary>
 52    /// dust_limit_satoshis is the threshold below which outputs should not be generated for this node's commitment or
 53    /// HTLC transactions
 54    /// </summary>
 3655    public LightningMoney DustLimitAmount { get; } = dustLimitAmount;
 56
 57    /// <summary>
 58    /// max_htlc_value_in_flight_msat is a cap on total value of outstanding HTLCs offered by the remote node, which
 59    /// allows the local node to limit its exposure to HTLCs
 60    /// </summary>
 3661    public LightningMoney MaxHtlcValueInFlightAmount { get; } = maxHtlcValueInFlight;
 62
 63    /// <summary>
 64    /// htlc_minimum_msat indicates the smallest value HTLC this node will accept.
 65    /// </summary>
 3666    public LightningMoney HtlcMinimumAmount { get; } = htlcMinimumAmount;
 67
 68    /// <summary>
 69    /// to_self_delay is how long (in blocks) the other node will have to wait in case of breakdown before redeeming
 70    /// its own funds.
 71    /// </summary>
 3672    public ushort ToSelfDelay { get; } = toSelfDelay;
 73
 74    /// <summary>
 75    /// max_accepted_htlcs limits the number of outstanding HTLCs the remote node can offer.
 76    /// </summary>
 3677    public ushort MaxAcceptedHtlcs { get; } = maxAcceptedHtlcs;
 78
 79    /// <summary>
 80    /// locktime is the locktime for the funding transaction.
 81    /// </summary>
 3682    public uint Locktime { get; } = locktime;
 83
 84    /// <summary>
 85    /// funding_pubkey is the public key in the 2-of-2 multisig script of the funding transaction output.
 86    /// </summary>
 3687    public PubKey FundingPubKey { get; } = fundingPubKey;
 88
 89    /// <summary>
 90    /// revocation_basepoint is used to regenerate the scripts required for the penalty transaction
 91    /// </summary>
 3692    public PubKey RevocationBasepoint { get; } = revocationBasepoint;
 93
 94    /// <summary>
 95    /// payment_basepoint is used to produce payment signatures for the protocol
 96    /// </summary>
 3697    public PubKey PaymentBasepoint { get; } = paymentBasepoint;
 98
 99    /// <summary>
 100    /// delayed_payment_basepoint is used to regenerate the scripts required for the penalty transaction
 101    /// </summary>
 36102    public PubKey DelayedPaymentBasepoint { get; } = delayedPaymentBasepoint;
 103
 104    /// <summary>
 105    /// htlc_basepoint is used to produce HTLC signatures for the protocol
 106    /// </summary>
 36107    public PubKey HtlcBasepoint { get; } = htlcBasepoint;
 108
 109    /// <summary>
 110    /// first_per_commitment_point is the per-commitment point used for the first commitment transaction
 111    /// </summary>
 36112    public PubKey FirstPerCommitmentPoint { get; } = firstPerCommitmentPoint;
 113
 114    /// <summary>
 115    /// second_per_commitment_point is the per-commitment point used for the first commitment transaction
 116    /// </summary>
 36117    public PubKey SecondPerCommitmentPoint { get; } = secondPerCommitmentPoint;
 118
 119    /// <summary>
 120    /// Only the least-significant bit of channel_flags is currently defined: announce_channel. This indicates whether
 121    /// the initiator of the funding flow wishes to advertise this channel publicly to the network
 122    /// </summary>
 36123    public ChannelFlags ChannelFlags { get; } = channelFlags;
 124}