Skip to content

Commit 31452a6

Browse files
authored
Merge pull request #10374 from ziggie1984/bugfix/fix-unit-test
Fix unit test for onion messages
2 parents 841a291 + 84504fa commit 31452a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lnwire/onion_message.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func NewOnionMessage(pathKey *btcec.PublicKey,
3636
// A compile-time check to ensure OnionMessage implements the Message interface.
3737
var _ Message = (*OnionMessage)(nil)
3838

39+
var _ SizeableMessage = (*OnionMessage)(nil)
40+
3941
// Decode reads the bytes stream and converts it to the object.
4042
func (o *OnionMessage) Decode(r io.Reader, _ uint32) error {
4143
if err := ReadElement(r, &o.PathKey); err != nil {
@@ -79,3 +81,10 @@ func (o *OnionMessage) Encode(w *bytes.Buffer, _ uint32) error {
7981
func (o *OnionMessage) MsgType() MessageType {
8082
return MsgOnionMessage
8183
}
84+
85+
// SerializedSize returns the serialized size of the message in bytes.
86+
//
87+
// This is part of the lnwire.SizeableMessage interface.
88+
func (o *OnionMessage) SerializedSize() (uint32, error) {
89+
return MessageSerializedSize(o)
90+
}

0 commit comments

Comments
 (0)