< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Bitcoin.ValueObjects.ExtPrivKey
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Bitcoin/ValueObjects/ExtPrivKey.cs
Tag: 36_15743069263
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 29
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Value()100%210%
.ctor(...)0%2040%
op_Implicit(...)100%210%
op_Implicit(...)100%210%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Bitcoin/ValueObjects/ExtPrivKey.cs

#LineLine coverage
 1namespace NLightning.Domain.Bitcoin.ValueObjects;
 2
 3using Crypto.Constants;
 4using Crypto.ValueObjects;
 5
 6public readonly record struct ExtPrivKey
 7{
 8    /// <summary>
 9    /// The private key value.
 10    /// </summary>
 011    public byte[] Value { get; }
 12
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="PrivKey"/> struct.
 15    /// </summary>
 16    /// <param name="value">The private key value.</param>
 17    public ExtPrivKey(byte[] value)
 18    {
 019        ArgumentNullException.ThrowIfNull(value);
 020        if (value is null || value.Length != CryptoConstants.ExtPrivkeyLen)
 021            throw new ArgumentException($"Private key must be {CryptoConstants.ExtPrivkeyLen} bytes long.",
 022                                        nameof(value));
 23
 024        Value = value;
 025    }
 26
 027    public static implicit operator ExtPrivKey(byte[] bytes) => new(bytes);
 028    public static implicit operator byte[](ExtPrivKey script) => script.Value;
 29}