mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 01:33:02 +01:00
lnwire: specify random fields for UpdateFulfillHTLC message in fuzz test
This commit defines random fields for the `UpdateFulfillHTLC` message as part of the encode/decode unit tests.
This commit is contained in:
parent
5c3f7bec0f
commit
406fbe243e
@ -1414,6 +1414,21 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
|
||||
v[0] = reflect.ValueOf(*req)
|
||||
},
|
||||
MsgUpdateFulfillHTLC: func(v []reflect.Value, r *rand.Rand) {
|
||||
req := UpdateFulfillHTLC{
|
||||
ID: r.Uint64(),
|
||||
}
|
||||
|
||||
_, err := r.Read(req.ChanID[:])
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = r.Read(req.PaymentPreimage[:])
|
||||
require.NoError(t, err)
|
||||
|
||||
req.CustomRecords = randCustomRecords(t, r)
|
||||
|
||||
v[0] = reflect.ValueOf(req)
|
||||
},
|
||||
}
|
||||
|
||||
// With the above types defined, we'll now generate a slice of
|
||||
|
Loading…
x
Reference in New Issue
Block a user