< Summary - Combined Code Coverage

Information
Class: NLightning.Transport.Ipc.MessagePack.Formatters.CompactPubKeyFormatter
Assembly: NLightning.Transport.Ipc
File(s): /home/runner/work/NLightning/NLightning/src/NLightning.Transport.Ipc/MessagePack/Formatters/CompactPubKeyFormatter.cs
Tag: 57_24045730253
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 22
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
Serialize(...)100%210%
Serialize(...)100%210%
Deserialize(...)0%2040%
Deserialize(...)0%2040%

File(s)

/home/runner/work/NLightning/NLightning/src/NLightning.Transport.Ipc/MessagePack/Formatters/CompactPubKeyFormatter.cs

#LineLine coverage
 1using System.Runtime.Serialization;
 2using MessagePack;
 3using MessagePack.Formatters;
 4
 5namespace NLightning.Transport.Ipc.MessagePack.Formatters;
 6
 7using Domain.Crypto.ValueObjects;
 8
 9[ExcludeFormatterFromSourceGeneratedResolver]
 10public class CompactPubKeyFormatter : IMessagePackFormatter<CompactPubKey>
 11{
 12    public void Serialize(ref MessagePackWriter writer, CompactPubKey value, MessagePackSerializerOptions options)
 013    {
 014        writer.Write((byte[])value);
 015    }
 16
 17    public CompactPubKey Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
 018    {
 019        return reader.ReadBytes()?.FirstSpan.ToArray() ??
 020               throw new SerializationException($"Error deserializing {nameof(CompactPubKey)})");
 021    }
 22}