< 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: 57_24045730253
Line coverage
0%
Covered lines: 0
Uncovered lines: 45
Coverable lines: 45
Total lines: 143
Line coverage: 0%
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>
 026    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
 0115    public OpenChannel1Payload(ChainHash chainHash, ChannelFlags channelFlags, ChannelId channelId,
 0116                               LightningMoney channelReserveAmount, CompactPubKey delayedPaymentBasepoint,
 0117                               LightningMoney dustLimitAmount, LightningMoney feeRatePerKw,
 0118                               CompactPubKey firstPerCommitmentPoint, LightningMoney fundingAmount,
 0119                               CompactPubKey fundingPubKey, CompactPubKey htlcBasepoint,
 0120                               LightningMoney htlcMinimumAmount, ushort maxAcceptedHtlcs,
 0121                               LightningMoney maxHtlcValueInFlight, CompactPubKey paymentBasepoint,
 0122                               LightningMoney pushAmount, CompactPubKey revocationBasepoint, ushort toSelfDelay)
 123    {
 0124        ChainHash = chainHash;
 0125        ChannelId = channelId;
 0126        FundingAmount = fundingAmount;
 0127        PushAmount = pushAmount;
 0128        DustLimitAmount = dustLimitAmount;
 0129        MaxHtlcValueInFlight = maxHtlcValueInFlight;
 0130        ChannelReserveAmount = channelReserveAmount;
 0131        HtlcMinimumAmount = htlcMinimumAmount;
 0132        FeeRatePerKw = feeRatePerKw;
 0133        ToSelfDelay = toSelfDelay;
 0134        MaxAcceptedHtlcs = maxAcceptedHtlcs;
 0135        FundingPubKey = fundingPubKey;
 0136        RevocationBasepoint = revocationBasepoint;
 0137        PaymentBasepoint = paymentBasepoint;
 0138        DelayedPaymentBasepoint = delayedPaymentBasepoint;
 0139        HtlcBasepoint = htlcBasepoint;
 0140        FirstPerCommitmentPoint = firstPerCommitmentPoint;
 0141        ChannelFlags = channelFlags;
 0142    }
 143}