lnwire: fix unit test for DynCommit

This commit is contained in:
yyforyongyu
2025-06-25 01:56:34 +08:00
parent 8456aef9eb
commit 828486e35a
2 changed files with 97 additions and 1 deletions

View File

@@ -25,10 +25,14 @@ type DynCommit struct {
ExtraData ExtraOpaqueData
}
// A compile time check to ensure DynAck implements the lnwire.Message
// A compile time check to ensure DynCommit implements the lnwire.Message
// interface.
var _ Message = (*DynCommit)(nil)
// A compile time check to ensure DynCommit implements the
// lnwire.SizeableMessage interface.
var _ SizeableMessage = (*DynCommit)(nil)
// Encode serializes the target DynAck into the passed io.Writer. Serialization
// will observe the rules defined by the passed protocol version.
//
@@ -133,3 +137,10 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
func (dc *DynCommit) MsgType() MessageType {
return MsgDynCommit
}
// SerializedSize returns the serialized size of the message in bytes.
//
// This is part of the lnwire.SizeableMessage interface.
func (dc *DynCommit) SerializedSize() (uint32, error) {
return MessageSerializedSize(dc)
}