< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Messages.AcceptChannel1Message
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Messages/AcceptChannel1Message.cs
Tag: 36_15743069263
Line coverage
70%
Covered lines: 7
Uncovered lines: 3
Coverable lines: 10
Total lines: 46
Line coverage: 70%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Payload()100%210%
get_UpfrontShutdownScriptTlv()100%11100%
get_ChannelTypeTlv()100%11100%
.ctor(...)50%4.37471.43%

File(s)

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

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Messages;
 2
 3using Constants;
 4using Models;
 5using Payloads;
 6using Tlv;
 7
 8/// <summary>
 9/// Represents an open_channel message.
 10/// </summary>
 11/// <remarks>
 12/// The accept_channel message is sent to the initiator in order to accept the channel opening.
 13/// The message type is 33.
 14/// </remarks>
 15public sealed class AcceptChannel1Message : BaseChannelMessage
 16{
 17    /// <summary>
 18    /// The payload of the message.
 19    /// </summary>
 020    public new AcceptChannel1Payload Payload { get => (AcceptChannel1Payload)base.Payload; }
 21
 22    /// <summary>
 23    /// Optional UpfrontShutdownScriptTlv
 24    /// </summary>
 2025    public UpfrontShutdownScriptTlv? UpfrontShutdownScriptTlv { get; }
 26
 27    /// <summary>
 28    /// Optional ChannelTypeTlv
 29    /// </summary>
 2030    public ChannelTypeTlv? ChannelTypeTlv { get; }
 31
 32    public AcceptChannel1Message(AcceptChannel1Payload payload,
 33                                 UpfrontShutdownScriptTlv? upfrontShutdownScriptTlv = null,
 34                                 ChannelTypeTlv? channelTypeTlv = null)
 2035        : base(MessageTypes.AcceptChannel, payload)
 36    {
 2037        UpfrontShutdownScriptTlv = upfrontShutdownScriptTlv;
 2038        ChannelTypeTlv = channelTypeTlv;
 39
 2040        if (UpfrontShutdownScriptTlv is not null || ChannelTypeTlv is not null)
 41        {
 042            Extension = new TlvStream();
 043            Extension.Add(UpfrontShutdownScriptTlv, ChannelTypeTlv);
 44        }
 2045    }
 46}