lnwire: add fuzz tests for new dynamic commitment message types

This commit is contained in:
Keagan McClelland
2023-10-14 12:00:30 -06:00
committed by Olaoluwa Osuntokun
parent 3e84d22eeb
commit 564bf852bb
2 changed files with 46 additions and 0 deletions

View File

@@ -800,6 +800,13 @@ func TestLightningWireProtocol(t *testing.T) {
v[0] = reflect.ValueOf(dr)
},
MsgDynAck: func(v []reflect.Value, r *rand.Rand) {
var da DynAck
rand.Read(da.ChanID[:])
v[0] = reflect.ValueOf(da)
},
MsgCommitSig: func(v []reflect.Value, r *rand.Rand) {
req := NewCommitSig()
if _, err := r.Read(req.ChanID[:]); err != nil {
@@ -1257,6 +1264,12 @@ func TestLightningWireProtocol(t *testing.T) {
return mainScenario(&m)
},
},
{
msgType: MsgDynAck,
scenario: func(m DynAck) bool {
return mainScenario(&m)
},
},
{
msgType: MsgUpdateAddHTLC,
scenario: func(m UpdateAddHTLC) bool {