Merge pull request #10374 from ziggie1984/bugfix/fix-unit-test

Fix unit test for onion messages
This commit is contained in:
Yong authored and GitHub committed 2025-11-17 21:25:45 +08:00
commit 31452a66a5
1 file changed
+9
+9
View File
@@ -36,6 +36,8 @@ func NewOnionMessage(pathKey *btcec.PublicKey,
// A compile-time check to ensure OnionMessage implements the Message interface.
var _ Message = (*OnionMessage)(nil)
var _ SizeableMessage = (*OnionMessage)(nil)
// Decode reads the bytes stream and converts it to the object.
func (o *OnionMessage) Decode(r io.Reader, _ uint32) error {
if err := ReadElement(r, &o.PathKey); err != nil {
@@ -79,3 +81,10 @@ func (o *OnionMessage) Encode(w *bytes.Buffer, _ uint32) error {
func (o *OnionMessage) MsgType() MessageType {
return MsgOnionMessage
}
// SerializedSize returns the serialized size of the message in bytes.
//
// This is part of the lnwire.SizeableMessage interface.
func (o *OnionMessage) SerializedSize() (uint32, error) {
return MessageSerializedSize(o)
}