< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Messages.OpenChannel1Message
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Messages/OpenChannel1Message.cs
Tag: 36_15743069263
Line coverage
80%
Covered lines: 8
Uncovered lines: 2
Coverable lines: 10
Total lines: 38
Line coverage: 80%
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%11100%
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/OpenChannel1Message.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 open_channel message is sent to another peer in order to start the channel negotiation.
 13/// The message type is 32.
 14/// </remarks>
 15public sealed class OpenChannel1Message : BaseChannelMessage
 16{
 17    /// <summary>
 18    /// The payload of the message.
 19    /// </summary>
 4420    public new OpenChannel1Payload Payload { get => (OpenChannel1Payload)base.Payload; }
 21
 2022    public UpfrontShutdownScriptTlv? UpfrontShutdownScriptTlv { get; }
 2023    public ChannelTypeTlv? ChannelTypeTlv { get; }
 24
 25    public OpenChannel1Message(OpenChannel1Payload payload, UpfrontShutdownScriptTlv? upfrontShutdownScriptTlv = null,
 26                               ChannelTypeTlv? channelTypeTlv = null)
 2027        : base(MessageTypes.OpenChannel, payload)
 28    {
 2029        UpfrontShutdownScriptTlv = upfrontShutdownScriptTlv;
 2030        ChannelTypeTlv = channelTypeTlv;
 31
 2032        if (UpfrontShutdownScriptTlv is not null || ChannelTypeTlv is not null)
 33        {
 034            Extension = new TlvStream();
 035            Extension.Add(UpfrontShutdownScriptTlv, ChannelTypeTlv);
 36        }
 2037    }
 38}