lnwire: update testing.Quick tests to alternate between encoding types
This commit is contained in:
parent
5caf3d7310
commit
940b95aad7
@ -651,9 +651,14 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
v[0] = reflect.ValueOf(req)
|
||||
},
|
||||
MsgQueryShortChanIDs: func(v []reflect.Value, r *rand.Rand) {
|
||||
req := QueryShortChanIDs{
|
||||
// TODO(roasbeef): later alternate encoding types
|
||||
EncodingType: EncodingSortedPlain,
|
||||
req := QueryShortChanIDs{}
|
||||
|
||||
// With a 50/50 change, we'll either use zlib encoding,
|
||||
// or regular encoding.
|
||||
if r.Int31()%2 == 0 {
|
||||
req.EncodingType = EncodingSortedZlib
|
||||
} else {
|
||||
req.EncodingType = EncodingSortedPlain
|
||||
}
|
||||
|
||||
if _, err := rand.Read(req.ChainHash[:]); err != nil {
|
||||
@ -687,8 +692,13 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
|
||||
req.Complete = uint8(r.Int31n(2))
|
||||
|
||||
// TODO(roasbeef): later alternate encoding types
|
||||
req.EncodingType = EncodingSortedPlain
|
||||
// With a 50/50 change, we'll either use zlib encoding,
|
||||
// or regular encoding.
|
||||
if r.Int31()%2 == 0 {
|
||||
req.EncodingType = EncodingSortedZlib
|
||||
} else {
|
||||
req.EncodingType = EncodingSortedPlain
|
||||
}
|
||||
|
||||
numChanIDs := rand.Int31n(5000)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user