< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Channels.ValueObjects.ChannelFlags
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Channels/ValueObjects/ChannelFlags.cs
Tag: 36_15743069263
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 34
Line coverage: 100%
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

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_AnnounceChannel()100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
op_Implicit(...)100%11100%
op_Implicit(...)100%11100%
op_Implicit(...)100%11100%
op_Implicit(...)100%11100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Channels/ValueObjects/ChannelFlags.cs

#LineLine coverage
 1namespace NLightning.Domain.Channels.ValueObjects;
 2
 3using Domain.Enums;
 4using Domain.Interfaces;
 5
 6/// <summary>
 7/// Only the least-significant bit of channel_flags is currently defined: announce_channel. This indicates whether
 8/// the initiator of the funding flow wishes to advertise this channel publicly to the network
 9/// </summary>
 10public readonly record struct ChannelFlags : IValueObject, IEquatable<ChannelFlags>
 11{
 12    private readonly byte _value;
 13
 1614    public bool AnnounceChannel => ((ChannelFlag)_value).HasFlag(ChannelFlag.AnnounceChannel);
 15
 16    public ChannelFlags(byte value)
 17    {
 4018        _value = value;
 4019    }
 20
 21    public ChannelFlags(ChannelFlag value)
 22    {
 2423        _value = (byte)value;
 2424    }
 25
 26    #region Implicit Conversions
 27
 2428    public static implicit operator byte(ChannelFlags c) => c._value;
 429    public static implicit operator ChannelFlags(byte value) => new(value);
 430    public static implicit operator byte[](ChannelFlags c) => [c._value];
 431    public static implicit operator ChannelFlags(byte[] value) => new(value[0]);
 32
 33    #endregion
 34}