mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 21:35:24 +01:00
lnwire: add custom message to fuzz tests
This commit is contained in:
parent
35caaf3c53
commit
88a8c6618d
@ -807,3 +807,18 @@ func FuzzUpdateFulfillHTLC(f *testing.F) {
|
||||
harness(t, data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzCustomMessage(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte, customMessageType uint16) {
|
||||
if customMessageType < uint16(CustomTypeStart) {
|
||||
customMessageType += uint16(CustomTypeStart)
|
||||
}
|
||||
|
||||
// Prefix with CustomMessage.
|
||||
data = prefixWithMsgType(data, MessageType(customMessageType))
|
||||
|
||||
// Pass the message into our general fuzz harness for wire
|
||||
// messages!
|
||||
harness(t, data)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user