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

lightningnetwork / lnd / 15561477203

10 Jun 2025 01:54PM UTC coverage: 58.351% (-10.1%) from 68.487%
15561477203

Pull #9356

github

web-flow
Merge 6440b25db into c6d6d4c0b
Pull Request #9356: lnrpc: add incoming/outgoing channel ids filter to forwarding history request

33 of 36 new or added lines in 2 files covered. (91.67%)

28366 existing lines in 455 files now uncovered.

97715 of 167461 relevant lines covered (58.35%)

1.81 hits per line

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

0.0
/watchtower/wtwire/error.go
1
package wtwire
2

3
import "io"
4

5
// Error is a generic error message that can be sent to a client if a request
6
// fails outside of prescribed protocol errors. Typically this would be followed
7
// by the server disconnecting the client, and so can be useful to transferring
8
// the exact reason.
9
type Error struct {
10
        // Code specifies the error code encountered by the server.
11
        Code ErrorCode
12

13
        // Data encodes a payload whose contents can be interpreted by the
14
        // client in response to the error code.
15
        Data []byte
16
}
17

18
// NewError returns an freshly-initialized Error message.
19
func NewError() *Error {
×
20
        return &Error{}
×
21
}
×
22

23
// A compile time check to ensure Error implements the wtwire.Message interface.
24
var _ Message = (*Error)(nil)
25

26
// Decode deserializes a serialized Error message stored in the passed io.Reader
27
// observing the specified protocol version.
28
//
29
// This is part of the wtwire.Message interface.
UNCOV
30
func (e *Error) Decode(r io.Reader, pver uint32) error {
×
UNCOV
31
        return ReadElements(r,
×
UNCOV
32
                &e.Code,
×
UNCOV
33
                &e.Data,
×
UNCOV
34
        )
×
UNCOV
35
}
×
36

37
// Encode serializes the target Error into the passed io.Writer observing the
38
// protocol version specified.
39
//
40
// This is part of the wtwire.Message interface.
UNCOV
41
func (e *Error) Encode(w io.Writer, prver uint32) error {
×
UNCOV
42
        return WriteElements(w,
×
UNCOV
43
                e.Code,
×
UNCOV
44
                e.Data,
×
UNCOV
45
        )
×
UNCOV
46
}
×
47

48
// MsgType returns the integer uniquely identifying this message type on the
49
// wire.
50
//
51
// This is part of the wtwire.Message interface.
UNCOV
52
func (e *Error) MsgType() MessageType {
×
UNCOV
53
        return MsgError
×
UNCOV
54
}
×
55

56
// MaxPayloadLength returns the maximum allowed payload size for a Error
57
// complete message observing the specified protocol version.
58
//
59
// This is part of the wtwire.Message interface.
UNCOV
60
func (e *Error) MaxPayloadLength(uint32) uint32 {
×
UNCOV
61
        return MaxMessagePayload
×
UNCOV
62
}
×
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