lnwire: add new TestMessage interface for property tests
In this commit, we add a new `TestMessage` interface for use in property tests. With this, we'll be able to generate a random instance of a given message, using the rapid byte stream. This can also eventually be useful for fuzzing.
This commit is contained in:
25 files changed
+2090
-32
No files matched your search
@@ -110,10 +110,6 @@ func NewUpdateAddHTLC() *UpdateAddHTLC {
|
||||
// interface.
|
||||
var _ Message = (*UpdateAddHTLC)(nil)
|
||||
|
||||
// A compile time check to ensure UpdateAddHTLC implements the lnwire.SizeableMessage
|
||||
// interface.
|
||||
var _ SizeableMessage = (*UpdateAddHTLC)(nil)
|
||||
|
||||
// Decode deserializes a serialized UpdateAddHTLC message stored in the passed
|
||||
// io.Reader observing the specified protocol version.
|
||||
//
|
||||
@@ -223,3 +219,7 @@ func (c *UpdateAddHTLC) TargetChanID() ChannelID {
|
||||
func (c *UpdateAddHTLC) SerializedSize() (uint32, error) {
|
||||
return MessageSerializedSize(c)
|
||||
}
|
||||
|
||||
// A compile time check to ensure UpdateAddHTLC implements the
|
||||
// lnwire.SizeableMessage interface.
|
||||
var _ SizeableMessage = (*UpdateAddHTLC)(nil)
|
||||
Reference in new issue
Block a user