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

lightningnetwork / lnd / 13999301927

21 Mar 2025 07:18PM UTC coverage: 68.989% (+9.9%) from 59.126%
13999301927

push

github

web-flow
Merge pull request #9623 from Roasbeef/size-msg-test-msg

Size msg test msg

1461 of 1572 new or added lines in 43 files covered. (92.94%)

28 existing lines in 6 files now uncovered.

132898 of 192637 relevant lines covered (68.99%)

22200.59 hits per line

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

58.33
/lnwire/reply_short_chan_ids_end.go
1
package lnwire
2

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

7
        "github.com/btcsuite/btcd/chaincfg/chainhash"
8
)
9

10
// ReplyShortChanIDsEnd is a message that marks the end of a streaming message
11
// response to an initial QueryShortChanIDs message. This marks that the
12
// receiver of the original QueryShortChanIDs for the target chain has either
13
// sent all adequate responses it knows of, or doesn't know of any short chan
14
// ID's for the target chain.
15
type ReplyShortChanIDsEnd struct {
16
        // ChainHash denotes the target chain that we're respond to a short
17
        // chan ID query for.
18
        ChainHash chainhash.Hash
19

20
        // Complete will be set to 0 if we don't know of the chain that the
21
        // remote peer sent their query for. Otherwise, we'll set this to 1 in
22
        // order to indicate that we've sent all known responses for the prior
23
        // set of short chan ID's in the corresponding QueryShortChanIDs
24
        // message.
25
        Complete uint8
26

27
        // ExtraData is the set of data that was appended to this message to
28
        // fill out the full maximum transport message size. These fields can
29
        // be used to specify optional data such as custom TLV fields.
30
        ExtraData ExtraOpaqueData
31
}
32

33
// NewReplyShortChanIDsEnd creates a new empty ReplyShortChanIDsEnd message.
34
func NewReplyShortChanIDsEnd() *ReplyShortChanIDsEnd {
×
35
        return &ReplyShortChanIDsEnd{}
×
36
}
×
37

38
// A compile time check to ensure ReplyShortChanIDsEnd implements the
39
// lnwire.Message interface.
40
var _ Message = (*ReplyShortChanIDsEnd)(nil)
41

42
// A compile time check to ensure ReplyShortChanIDsEnd implements the
43
// lnwire.SizeableMessage interface.
44
var _ SizeableMessage = (*ReplyShortChanIDsEnd)(nil)
45

46
// Decode deserializes a serialized ReplyShortChanIDsEnd message stored in the
47
// passed io.Reader observing the specified protocol version.
48
//
49
// This is part of the lnwire.Message interface.
50
func (c *ReplyShortChanIDsEnd) Decode(r io.Reader, pver uint32) error {
133✔
51
        return ReadElements(r,
133✔
52
                c.ChainHash[:],
133✔
53
                &c.Complete,
133✔
54
                &c.ExtraData,
133✔
55
        )
133✔
56
}
133✔
57

58
// Encode serializes the target ReplyShortChanIDsEnd into the passed io.Writer
59
// observing the protocol version specified.
60
//
61
// This is part of the lnwire.Message interface.
62
func (c *ReplyShortChanIDsEnd) Encode(w *bytes.Buffer, pver uint32) error {
117✔
63
        if err := WriteBytes(w, c.ChainHash[:]); err != nil {
117✔
64
                return err
×
65
        }
×
66

67
        if err := WriteUint8(w, c.Complete); err != nil {
117✔
68
                return err
×
69
        }
×
70

71
        return WriteBytes(w, c.ExtraData)
117✔
72
}
73

74
// MsgType returns the integer uniquely identifying this message type on the
75
// wire.
76
//
77
// This is part of the lnwire.Message interface.
78
func (c *ReplyShortChanIDsEnd) MsgType() MessageType {
117✔
79
        return MsgReplyShortChanIDsEnd
117✔
80
}
117✔
81

82
// SerializedSize returns the serialized size of the message in bytes.
83
//
84
// This is part of the lnwire.SizeableMessage interface.
NEW
85
func (c *ReplyShortChanIDsEnd) SerializedSize() (uint32, error) {
×
NEW
86
        return MessageSerializedSize(c)
×
NEW
87
}
×
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