consensus/types: fix BenchmarkRoundStateDeepCopy panics (#4244)

Fixes #4243
This commit is contained in:
Cuong Manh Le
2019-12-12 23:32:33 +07:00
committed by Marko
parent 7b52f51700
commit c9708105f0
2 changed files with 5 additions and 2 deletions

View File

@@ -132,3 +132,4 @@ program](https://hackerone.com/tendermint).
- [types] \#4164 Prevent temporary power overflows on validator updates (joint
efforts of @gchaincl and @ancazamfir)
- [p2p] \#4140 `SecretConnection`: use the transcript solely for authentication (i.e. MAC)
- [consensus/types] \#4243 fix BenchmarkRoundStateDeepCopy panics (@cuonglm)

View File

@@ -5,6 +5,7 @@ import (
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"
@@ -18,9 +19,10 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) {
vset, _ := types.RandValidatorSet(nval, 1)
commitSigs := make([]types.CommitSig, nval)
blockID := types.BlockID{
Hash: rand.RandBytes(20),
Hash: rand.RandBytes(tmhash.Size),
PartsHeader: types.PartSetHeader{
Hash: rand.RandBytes(20),
Hash: rand.RandBytes(tmhash.Size),
Total: 1000,
},
}
sig := make([]byte, ed25519.SignatureSize)