< 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: 57_24045730253
Line coverage
0%
Covered lines: 0
Uncovered lines: 26
Coverable lines: 26
Total lines: 141
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.Enums;
 7using Domain.Bitcoin.ValueObjects;
 8using Domain.Channels.ValueObjects;
 9using Domain.Crypto.ValueObjects;
 10
 11/// <summary>
 12/// Represents a Lightning Network payment channel entity in the persistence layer.
 13/// </summary>
 14public class ChannelEntity
 15{
 16    /// <summary>
 17    /// The unique channel identifier used to reference this channel on the Lightning Network.
 18    /// </summary>
 019    public required ChannelId ChannelId { get; set; }
 20
 21    /// <summary>
 22    /// The block height at which the funding transaction for the channel was created.
 23    /// Used to track the blockchain state relevant to the channel's funding process.
 24    /// </summary>
 025    public uint FundingCreatedAtBlockHeight { get; set; }
 26
 27    /// <summary>
 28    /// The transaction ID of the funding transaction that established this channel.
 29    /// </summary>
 030    public required TxId FundingTxId { get; set; }
 31
 32    /// <summary>
 33    /// The output index in the funding transaction that contains the channel funding.
 34    /// </summary>
 035    public required ushort FundingOutputIndex { get; set; }
 36
 37    /// <summary>
 38    /// The amount of satoshis locked in the funding output for this channel.
 39    /// </summary>
 040    public required long FundingAmountSatoshis { get; set; }
 41
 42    /// <summary>
 43    /// Indicates whether the local node initiated the channel opening.
 44    /// </summary>
 045    public required bool IsInitiator { get; set; }
 46
 47    /// <summary>
 48    /// The public key of the channel counterparty.
 49    /// </summary>
 050    public required CompactPubKey RemoteNodeId { get; set; }
 51
 52    /// <summary>
 53    /// The next HTLC ID to be used by the local node.
 54    /// </summary>
 055    public required ulong LocalNextHtlcId { get; set; }
 56
 57    /// <summary>
 58    /// The next HTLC ID to be used by the remote node.
 59    /// </summary>
 060    public required ulong RemoteNextHtlcId { get; set; }
 61
 62    /// <summary>
 63    /// The current local revocation number.
 64    /// </summary>
 065    public required ulong LocalRevocationNumber { get; set; }
 66
 67    /// <summary>
 68    /// The current remote revocation number.
 69    /// </summary>
 070    public required ulong RemoteRevocationNumber { get; set; }
 71
 72    /// <summary>
 73    /// The last signature sent to the remote node, stored as a byte array.
 74    /// </summary>
 075    public byte[]? LastSentSignature { get; set; }
 76
 77    /// <summary>
 78    /// The last signature received from the remote node, stored as a byte array.
 79    /// </summary>
 080    public byte[]? LastReceivedSignature { get; set; }
 81
 82    /// <summary>
 83    /// The current state of the channel.
 84    /// </summary>
 085    public required byte State { get; set; }
 86
 87    /// <summary>
 88    /// Indicates the channel format version associated with this channel entity,
 89    /// used to handle version-specific behaviors within the persistence layer.
 90    /// </summary>
 091    public required byte Version { get; set; }
 92
 93    /// <summary>
 94    /// The current balance of the local node in satoshis.
 95    /// </summary>
 096    public required decimal LocalBalanceSatoshis { get; set; }
 97
 98    /// <summary>
 99    /// The current balance of the remote node in satoshis.
 100    /// </summary>
 0101    public required decimal RemoteBalanceSatoshis { get; set; }
 102
 0103    public AddressType? ChangeAddressType { get; set; }
 0104    public uint? ChangeAddressIndex { get; set; }
 105
 106    /// <summary>
 107    /// The change address used by the funding transaction, if there's one
 108    /// </summary>
 0109    public virtual WalletAddressEntity? ChangeAddress { get; set; }
 110
 111    /// <summary>
 112    /// Represents the configuration settings associated with the Lightning Network payment channel,
 113    /// defining operational parameters such as limits, timeouts, and other key configurations.
 114    /// </summary>
 0115    public virtual ChannelConfigEntity? Config { get; set; }
 116
 117    /// <summary>
 118    /// Collection of cryptographic key sets related to the Lightning Network channel.
 119    /// Defines entities that store and track keys associated with different roles (local/remote) in the channel.
 120    /// </summary>
 0121    public virtual ICollection<ChannelKeySetEntity>? KeySets { get; set; }
 122
 123    /// <summary>
 124    /// The collection of HTLC (Hashed TimeLock Contracts) entities associated with this payment channel.
 125    /// Each HTLC represents a conditional payment in the channel.
 126    /// </summary>
 0127    public virtual ICollection<HtlcEntity>? Htlcs { get; set; }
 128
 129    /// <summary>
 130    /// A collection of transactions that are monitored for a specific channel,
 131    /// typically to track and validate on-chain activity related to the channel's lifecycle.
 132    /// </summary>
 0133    public virtual ICollection<WatchedTransactionEntity>? WatchedTransactions { get; set; }
 134
 135    /// <summary>
 136    /// Default constructor for EF Core.
 137    /// </summary>
 0138    internal ChannelEntity()
 139    {
 0140    }
 141}