< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Payloads.OpenChannel1Payload
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/OpenChannel1Payload.cs
Tag: 36_15743069263
Line coverage
62%
Covered lines: 28
Uncovered lines: 17
Coverable lines: 45
Total lines: 143
Line coverage: 62.2%
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/OpenChannel1Payload.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_channel message.
 11/// </summary>
 12/// <remarks>
 13/// Initializes a new instance of the OpenChannel1Payload class.
 14/// </remarks>
 15public class OpenChannel1Payload : IChannelMessagePayload
 16{
 17    /// <summary>
 18    /// The chain_hash value denotes the exact blockchain that the opened channel will reside within.
 19    /// </summary>
 020    public ChainHash ChainHash { get; }
 21
 22    /// <summary>
 23    /// The temporary_channel_id is used to identify this channel on a per-peer basis until the funding transaction
 24    /// is established, at which point it is replaced by the channel_id, which is derived from the funding transaction.
 25    /// </summary>
 4826    public ChannelId ChannelId { get; }
 27
 28    /// <summary>
 29    /// funding_satoshis is the amount the sender is putting into the channel.
 30    /// </summary>
 31    /// <remarks>Amount is used in Satoshis</remarks>
 032    public LightningMoney FundingAmount { get; }
 33
 34    /// <summary>
 35    /// push_msat is the amount the sender is pushing to the receiver of the channel.
 36    /// </summary>
 37    /// <remarks>Amount is used in Millisatoshis</remarks>
 038    public LightningMoney PushAmount { get; }
 39
 40    /// <summary>
 41    /// dust_limit_satoshis is the threshold below which outputs should not be generated for this node's commitment or
 42    /// HTLC transactions
 43    /// </summary>
 044    public LightningMoney DustLimitAmount { get; }
 45
 46    /// <summary>
 47    /// max_htlc_value_in_flight_msat is a cap on total value of outstanding HTLCs offered by the remote node, which
 48    /// allows the local node to limit its exposure to HTLCs
 49    /// </summary>
 050    public LightningMoney MaxHtlcValueInFlight { get; }
 51
 52    /// <summary>
 53    /// channel_reserve_satoshis is the amount that must remain in the channel after a commitment transaction
 54    /// </summary>
 055    public LightningMoney ChannelReserveAmount { get; }
 56
 57    /// <summary>
 58    /// htlc_minimum_msat indicates the smallest value HTLC this node will accept.
 59    /// </summary>
 060    public LightningMoney HtlcMinimumAmount { get; }
 61
 62    /// <summary>
 63    /// feerate_per_kw is the fee rate that will be paid for the commitment transaction in
 64    /// satoshi per 1000-weight
 65    /// </summary>
 066    public LightningMoney FeeRatePerKw { get; }
 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>
 072    public ushort ToSelfDelay { get; }
 73
 74    /// <summary>
 75    /// max_accepted_htlcs limits the number of outstanding HTLCs the remote node can offer.
 76    /// </summary>
 077    public ushort MaxAcceptedHtlcs { get; }
 78
 79    /// <summary>
 80    /// funding_pubkey is the public key in the 2-of-2 multisig script of the funding transaction output.
 81    /// </summary>
 082    public CompactPubKey FundingPubKey { get; }
 83
 84    /// <summary>
 85    /// revocation_basepoint is used to regenerate the scripts required for the penalty transaction
 86    /// </summary>
 087    public CompactPubKey RevocationBasepoint { get; }
 88
 89    /// <summary>
 90    /// payment_basepoint is used to produce payment signatures for the protocol
 91    /// </summary>
 092    public CompactPubKey PaymentBasepoint { get; }
 93
 94    /// <summary>
 95    /// delayed_payment_basepoint is used to regenerate the scripts required for the penalty transaction
 96    /// </summary>
 097    public CompactPubKey DelayedPaymentBasepoint { get; }
 98
 99    /// <summary>
 100    /// htlc_basepoint is used to produce HTLC signatures for the protocol
 101    /// </summary>
 0102    public CompactPubKey HtlcBasepoint { get; }
 103
 104    /// <summary>
 105    /// first_per_commitment_point is the per-commitment point used for the first commitment transaction
 106    /// </summary>
 0107    public CompactPubKey FirstPerCommitmentPoint { get; }
 108
 109    /// <summary>
 110    /// Only the least-significant bit of channel_flags is currently defined: announce_channel. This indicates whether
 111    /// the initiator of the funding flow wishes to advertise this channel publicly to the network
 112    /// </summary>
 0113    public ChannelFlags ChannelFlags { get; }
 114
 20115    public OpenChannel1Payload(ChainHash chainHash, ChannelFlags channelFlags, ChannelId channelId,
 20116                               LightningMoney channelReserveAmount, CompactPubKey delayedPaymentBasepoint,
 20117                               LightningMoney dustLimitAmount, LightningMoney feeRatePerKw,
 20118                               CompactPubKey firstPerCommitmentPoint, LightningMoney fundingAmount,
 20119                               CompactPubKey fundingPubKey, CompactPubKey htlcBasepoint,
 20120                               LightningMoney htlcMinimumAmount, ushort maxAcceptedHtlcs,
 20121                               LightningMoney maxHtlcValueInFlight, CompactPubKey paymentBasepoint,
 20122                               LightningMoney pushAmount, CompactPubKey revocationBasepoint, ushort toSelfDelay)
 123    {
 20124        ChainHash = chainHash;
 20125        ChannelId = channelId;
 20126        FundingAmount = fundingAmount;
 20127        PushAmount = pushAmount;
 20128        DustLimitAmount = dustLimitAmount;
 20129        MaxHtlcValueInFlight = maxHtlcValueInFlight;
 20130        ChannelReserveAmount = channelReserveAmount;
 20131        HtlcMinimumAmount = htlcMinimumAmount;
 20132        FeeRatePerKw = feeRatePerKw;
 20133        ToSelfDelay = toSelfDelay;
 20134        MaxAcceptedHtlcs = maxAcceptedHtlcs;
 20135        FundingPubKey = fundingPubKey;
 20136        RevocationBasepoint = revocationBasepoint;
 20137        PaymentBasepoint = paymentBasepoint;
 20138        DelayedPaymentBasepoint = delayedPaymentBasepoint;
 20139        HtlcBasepoint = htlcBasepoint;
 20140        FirstPerCommitmentPoint = firstPerCommitmentPoint;
 20141        ChannelFlags = channelFlags;
 20142    }
 143}