• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13980885714

20 Mar 2025 10:53PM UTC coverage: 58.613% (-10.2%) from 68.789%
13980885714

Pull #9623

github

web-flow
Merge 9eaec1f7a into 09b674508
Pull Request #9623: Size msg test msg

0 of 1572 new or added lines in 42 files covered. (0.0%)

27755 existing lines in 442 files now uncovered.

96886 of 165299 relevant lines covered (58.61%)

1.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lnwire/kickoff_sig.go
1
package lnwire
2

3
import (
4
        "bytes"
5
        "io"
6

7
        "pgregory.net/rapid"
8
)
9

10
// KickoffSig is the message used to transmit the signature for a kickoff
11
// transaction during the execution phase of a dynamic commitment negotiation
12
// that requires a reanchoring step.
13
type KickoffSig struct {
14
        // ChanID identifies the channel id for which this signature is
15
        // intended.
16
        ChanID ChannelID
17

18
        // Signature contains the ECDSA signature that signs the kickoff
19
        // transaction.
20
        Signature Sig
21

22
        // ExtraData is the set of data that was appended to this message to
23
        // fill out the full maximum transport message size. These fields can
24
        // be used to specify optional data such as custom TLV fields.
25
        ExtraData ExtraOpaqueData
26
}
27

28
// A compile time check to ensure that KickoffSig implements the lnwire.Message
29
// interface.
30
var _ Message = (*KickoffSig)(nil)
31

32
// A compile time check to ensure KickoffSig implements the
33
// lnwire.SizeableMessage interface.
34
var _ SizeableMessage = (*KickoffSig)(nil)
35

36
// A compile time check to ensure KickoffSig implements the lnwire.TestMessage
37
// interface.
38
var _ TestMessage = (*KickoffSig)(nil)
39

40
// Encode serializes the target KickoffSig into the passed bytes.Buffer
41
// observing the specified protocol version.
42
//
43
// This is part of the lnwire.Message interface.
UNCOV
44
func (ks *KickoffSig) Encode(w *bytes.Buffer, _ uint32) error {
×
UNCOV
45
        if err := WriteChannelID(w, ks.ChanID); err != nil {
×
46
                return err
×
47
        }
×
UNCOV
48
        if err := WriteSig(w, ks.Signature); err != nil {
×
49
                return err
×
50
        }
×
51

UNCOV
52
        return WriteBytes(w, ks.ExtraData)
×
53
}
54

55
// Decode deserializes a serialized KickoffSig message stored in the passed
56
// io.Reader observing the specified protocol version.
57
//
58
// This is part of the lnwire.Message interface.
UNCOV
59
func (ks *KickoffSig) Decode(r io.Reader, _ uint32) error {
×
UNCOV
60
        return ReadElements(r, &ks.ChanID, &ks.Signature, &ks.ExtraData)
×
UNCOV
61
}
×
62

63
// MsgType returns the integer uniquely identifying KickoffSig on the wire.
64
//
65
// This is part of the lnwire.Message interface.
UNCOV
66
func (ks *KickoffSig) MsgType() MessageType { return MsgKickoffSig }
×
67

68
// SerializedSize returns the serialized size of the message in bytes.
69
//
70
// This is part of the lnwire.SizeableMessage interface.
NEW
71
func (ks *KickoffSig) SerializedSize() (uint32, error) {
×
NEW
72
        return MessageSerializedSize(ks)
×
NEW
73
}
×
74

75
// RandTestMessage populates the message with random data suitable for testing.
76
// It uses the rapid testing framework to generate random values.
77
//
78
// This is part of the TestMessage interface.
NEW
79
func (ks *KickoffSig) RandTestMessage(t *rapid.T) Message {
×
NEW
80
        return &KickoffSig{
×
NEW
81
                ChanID:    RandChannelID(t),
×
NEW
82
                Signature: RandSignature(t),
×
NEW
83
                ExtraData: RandExtraOpaqueData(t, nil),
×
NEW
84
        }
×
NEW
85
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc