< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Persistence.Entities.Channel.ChannelEntity
Assembly: NLightning.Infrastructure.Persistence
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure.Persistence/Entities/Channel/ChannelEntity.cs
Tag: 36_15743069263
Line coverage
0%
Covered lines: 0
Uncovered lines: 23
Coverable lines: 23
Total lines: 132
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.Infrastructure.Persistence/Entities/Channel/ChannelEntity.cs

#LineLine coverage
 1// ReSharper disable PropertyCanBeMadeInitOnly.Global
 2
 3namespace NLightning.Infrastructure.Persistence.Entities.Channel;
 4
 5using Bitcoin;
 6using Domain.Bitcoin.ValueObjects;
 7using Domain.Channels.ValueObjects;
 8using Domain.Crypto.ValueObjects;
 9
 10/// <summary>
 11/// Represents a Lightning Network payment channel entity in the persistence layer.
 12/// </summary>
 13public class ChannelEntity
 14{
 15    /// <summary>
 16    /// The unique channel identifier used to reference this channel on the Lightning Network.
 17    /// </summary>
 018    public required ChannelId ChannelId { get; set; }
 19
 20    /// <summary>
 21    /// The block height at which the funding transaction for the channel was created.
 22    /// Used to track the blockchain state relevant to the channel's funding process.
 23    /// </summary>
 024    public uint FundingCreatedAtBlockHeight { get; set; }
 25
 26    /// <summary>
 27    /// The transaction ID of the funding transaction that established this channel.
 28    /// </summary>
 029    public required TxId FundingTxId { get; set; }
 30
 31    /// <summary>
 32    /// The output index in the funding transaction that contains the channel funding.
 33    /// </summary>
 034    public required ushort FundingOutputIndex { get; set; }
 35
 36    /// <summary>
 37    /// The amount of satoshis locked in the funding output for this channel.
 38    /// </summary>
 039    public required long FundingAmountSatoshis { get; set; }
 40
 41    /// <summary>
 42    /// Indicates whether the local node initiated the channel opening.
 43    /// </summary>
 044    public required bool IsInitiator { get; set; }
 45
 46    /// <summary>
 47    /// The public key of the channel counterparty.
 48    /// </summary>
 049    public required CompactPubKey RemoteNodeId { get; set; }
 50
 51    /// <summary>
 52    /// The next HTLC ID to be used by the local node.
 53    /// </summary>
 054    public required ulong LocalNextHtlcId { get; set; }
 55
 56    /// <summary>
 57    /// The next HTLC ID to be used by the remote node.
 58    /// </summary>
 059    public required ulong RemoteNextHtlcId { get; set; }
 60
 61    /// <summary>
 62    /// The current local revocation number.
 63    /// </summary>
 064    public required ulong LocalRevocationNumber { get; set; }
 65
 66    /// <summary>
 67    /// The current remote revocation number.
 68    /// </summary>
 069    public required ulong RemoteRevocationNumber { get; set; }
 70
 71    /// <summary>
 72    /// The last signature sent to the remote node, stored as a byte array.
 73    /// </summary>
 074    public byte[]? LastSentSignature { get; set; }
 75
 76    /// <summary>
 77    /// The last signature received from the remote node, stored as a byte array.
 78    /// </summary>
 079    public byte[]? LastReceivedSignature { get; set; }
 80
 81    /// <summary>
 82    /// The current state of the channel.
 83    /// </summary>
 084    public required byte State { get; set; }
 85
 86    /// <summary>
 87    /// Indicates the channel format version associated with this channel entity,
 88    /// used to handle version-specific behaviors within the persistence layer.
 89    /// </summary>
 090    public required byte Version { get; set; }
 91
 92    /// <summary>
 93    /// The current balance of the local node in satoshis.
 94    /// </summary>
 095    public required decimal LocalBalanceSatoshis { get; set; }
 96
 97    /// <summary>
 98    /// The current balance of the remote node in satoshis.
 99    /// </summary>
 0100    public required decimal RemoteBalanceSatoshis { get; set; }
 101
 102    /// <summary>
 103    /// Represents the configuration settings associated with the Lightning Network payment channel,
 104    /// defining operational parameters such as limits, timeouts, and other key configurations.
 105    /// </summary>
 0106    public virtual ChannelConfigEntity? Config { get; set; }
 107
 108    /// <summary>
 109    /// Collection of cryptographic key sets related to the Lightning Network channel.
 110    /// Defines entities that store and track keys associated with different roles (local/remote) in the channel.
 111    /// </summary>
 0112    public virtual ICollection<ChannelKeySetEntity>? KeySets { get; set; }
 113
 114    /// <summary>
 115    /// The collection of HTLC (Hashed TimeLock Contracts) entities associated with this payment channel.
 116    /// Each HTLC represents a conditional payment in the channel.
 117    /// </summary>
 0118    public virtual ICollection<HtlcEntity>? Htlcs { get; set; }
 119
 120    /// <summary>
 121    /// A collection of transactions that are monitored for a specific channel,
 122    /// typically to track and validate on-chain activity related to the channel's lifecycle.
 123    /// </summary>
 0124    public virtual ICollection<WatchedTransactionEntity>? WatchedTransactions { get; set; }
 125
 126    /// <summary>
 127    /// Default constructor for EF Core.
 128    /// </summary>
 0129    internal ChannelEntity()
 130    {
 0131    }
 132}