lnwire: add timestamps to ReplyChannelRange msg

This commit is contained in:
Elle Mouton
2023-09-19 20:53:58 +02:00
parent 4872010779
commit 49a0370dcd
3 changed files with 368 additions and 20 deletions

View File

@@ -1159,12 +1159,25 @@ func TestLightningWireProtocol(t *testing.T) {
req.EncodingType = EncodingSortedPlain
}
numChanIDs := rand.Int31n(5000)
numChanIDs := rand.Int31n(4000)
for i := int32(0); i < numChanIDs; i++ {
req.ShortChanIDs = append(req.ShortChanIDs,
NewShortChanIDFromInt(uint64(r.Int63())))
}
// With a 50/50 chance, add some timestamps.
if r.Int31()%2 == 0 {
for i := int32(0); i < numChanIDs; i++ {
timestamps := ChanUpdateTimestamps{
Timestamp1: rand.Uint32(),
Timestamp2: rand.Uint32(),
}
req.Timestamps = append(
req.Timestamps, timestamps,
)
}
}
v[0] = reflect.ValueOf(req)
},
MsgQueryChannelRange: func(v []reflect.Value, r *rand.Rand) {