Merge pull request #10374 from ziggie1984/bugfix/fix-unit-test
Fix unit test for onion messages
This commit is contained in:
1 file changed
+9
@@ -36,6 +36,8 @@ func NewOnionMessage(pathKey *btcec.PublicKey,
|
|||||||
// A compile-time check to ensure OnionMessage implements the Message interface.
|
// A compile-time check to ensure OnionMessage implements the Message interface.
|
||||||
var _ Message = (*OnionMessage)(nil)
|
var _ Message = (*OnionMessage)(nil)
|
||||||
|
|
||||||
|
var _ SizeableMessage = (*OnionMessage)(nil)
|
||||||
|
|
||||||
// Decode reads the bytes stream and converts it to the object.
|
// Decode reads the bytes stream and converts it to the object.
|
||||||
func (o *OnionMessage) Decode(r io.Reader, _ uint32) error {
|
func (o *OnionMessage) Decode(r io.Reader, _ uint32) error {
|
||||||
if err := ReadElement(r, &o.PathKey); err != nil {
|
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 {
|
func (o *OnionMessage) MsgType() MessageType {
|
||||||
return MsgOnionMessage
|
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)
|
||||||
|
}
|
||||||
Reference in new issue
Block a user