< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Messages.AcceptChannel2Message
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Messages/AcceptChannel2Message.cs
Tag: 30_15166811759
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 50
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Payload()100%11100%
get_UpfrontShutdownScriptTlv()100%11100%
get_ChannelTypeTlv()100%11100%
get_RequireConfirmedInputsTlv()100%11100%
.ctor(...)100%66100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Messages/AcceptChannel2Message.cs

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Messages;
 2
 3using Constants;
 4using Models;
 5using Payloads;
 6using Tlv;
 7
 8/// <summary>
 9/// Represents an open_channel2 message.
 10/// </summary>
 11/// <remarks>
 12/// The accept_channel2 message is sent to the initiator to accept the channel opening.
 13/// The message type is 65.
 14/// </remarks>
 15public sealed class AcceptChannel2Message : BaseMessage
 16{
 17    /// <summary>
 18    /// The payload of the message.
 19    /// </summary>
 11220    public new AcceptChannel2Payload Payload { get => (AcceptChannel2Payload)base.Payload; }
 21
 22    /// <summary>
 23    /// Optional UpfrontShutdownScriptTlv
 24    /// </summary>
 3225    public UpfrontShutdownScriptTlv? UpfrontShutdownScriptTlv { get; }
 26
 27    /// <summary>
 28    /// Optional ChannelTypeTlv
 29    /// </summary>
 2430    public ChannelTypeTlv? ChannelTypeTlv { get; }
 31
 32    /// <summary>
 33    /// Optional RequireConfirmedInputsTlv
 34    /// </summary>
 2035    public RequireConfirmedInputsTlv? RequireConfirmedInputsTlv { get; }
 36
 37    public AcceptChannel2Message(AcceptChannel2Payload payload, UpfrontShutdownScriptTlv? upfrontShutdownScriptTlv = nul
 1638        : base(MessageTypes.ACCEPT_CHANNEL_2, payload)
 39    {
 1640        UpfrontShutdownScriptTlv = upfrontShutdownScriptTlv;
 1641        ChannelTypeTlv = channelTypeTlv;
 1642        RequireConfirmedInputsTlv = requireConfirmedInputsTlv;
 43
 1644        if (UpfrontShutdownScriptTlv is not null || ChannelTypeTlv is not null || RequireConfirmedInputsTlv is not null)
 45        {
 846            Extension = new TlvStream();
 847            Extension.Add(UpfrontShutdownScriptTlv, ChannelTypeTlv, RequireConfirmedInputsTlv);
 48        }
 1649    }
 50}