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

lightningnetwork / lnd / 15747152963

19 Jun 2025 01:22AM UTC coverage: 58.151% (-10.1%) from 68.248%
15747152963

push

github

web-flow
Merge pull request #9528 from Roasbeef/res-opt

fn: implement ResultOpt type for operations with optional values

97778 of 168145 relevant lines covered (58.15%)

1.81 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

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

16
        // Signature contains the ECDSA signature that signs the kickoff
17
        // transaction.
18
        Signature Sig
19

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

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

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

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

46
        return WriteBytes(w, ks.ExtraData)
×
47
}
48

49
// Decode deserializes a serialized KickoffSig message stored in the passed
50
// io.Reader observing the specified protocol version.
51
//
52
// This is part of the lnwire.Message interface.
53
func (ks *KickoffSig) Decode(r io.Reader, _ uint32) error {
×
54
        return ReadElements(r, &ks.ChanID, &ks.Signature, &ks.ExtraData)
×
55
}
×
56

57
// MsgType returns the integer uniquely identifying KickoffSig on the wire.
58
//
59
// This is part of the lnwire.Message interface.
60
func (ks *KickoffSig) MsgType() MessageType { return MsgKickoffSig }
×
61

62
// SerializedSize returns the serialized size of the message in bytes.
63
//
64
// This is part of the lnwire.SizeableMessage interface.
65
func (ks *KickoffSig) SerializedSize() (uint32, error) {
×
66
        return MessageSerializedSize(ks)
×
67
}
×
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