Skip to content

Commit 406fbe2

Browse files
committed
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.
1 parent 5c3f7be commit 406fbe2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lnwire/lnwire_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,21 @@ func TestLightningWireProtocol(t *testing.T) {
14141414

14151415
v[0] = reflect.ValueOf(*req)
14161416
},
1417+
MsgUpdateFulfillHTLC: func(v []reflect.Value, r *rand.Rand) {
1418+
req := UpdateFulfillHTLC{
1419+
ID: r.Uint64(),
1420+
}
1421+
1422+
_, err := r.Read(req.ChanID[:])
1423+
require.NoError(t, err)
1424+
1425+
_, err = r.Read(req.PaymentPreimage[:])
1426+
require.NoError(t, err)
1427+
1428+
req.CustomRecords = randCustomRecords(t, r)
1429+
1430+
v[0] = reflect.ValueOf(req)
1431+
},
14171432
}
14181433

14191434
// With the above types defined, we'll now generate a slice of

0 commit comments

Comments
 (0)