Merge branch 'master' into thane/8272-propagate-vote-extensions

This commit is contained in:
Thane Thomson
2022-04-29 08:08:14 -04:00
committed by GitHub
46 changed files with 371 additions and 342 deletions
+11 -12
View File
@@ -12,7 +12,6 @@ import (
"time"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/internal/test/factory"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/privval"
@@ -256,26 +255,26 @@ func makeHeaderRandom(chainID string, height int64) *types.Header {
Height: height,
Time: time.Now(),
LastBlockID: makeBlockID([]byte("headerhash"), 1000, []byte("partshash")),
LastCommitHash: crypto.CRandBytes(tmhash.Size),
DataHash: crypto.CRandBytes(tmhash.Size),
ValidatorsHash: crypto.CRandBytes(tmhash.Size),
NextValidatorsHash: crypto.CRandBytes(tmhash.Size),
ConsensusHash: crypto.CRandBytes(tmhash.Size),
AppHash: crypto.CRandBytes(tmhash.Size),
LastResultsHash: crypto.CRandBytes(tmhash.Size),
EvidenceHash: crypto.CRandBytes(tmhash.Size),
LastCommitHash: crypto.CRandBytes(crypto.HashSize),
DataHash: crypto.CRandBytes(crypto.HashSize),
ValidatorsHash: crypto.CRandBytes(crypto.HashSize),
NextValidatorsHash: crypto.CRandBytes(crypto.HashSize),
ConsensusHash: crypto.CRandBytes(crypto.HashSize),
AppHash: crypto.CRandBytes(crypto.HashSize),
LastResultsHash: crypto.CRandBytes(crypto.HashSize),
EvidenceHash: crypto.CRandBytes(crypto.HashSize),
ProposerAddress: crypto.CRandBytes(crypto.AddressSize),
}
}
func makeRandomBlockID() types.BlockID {
return makeBlockID(crypto.CRandBytes(tmhash.Size), 100, crypto.CRandBytes(tmhash.Size))
return makeBlockID(crypto.CRandBytes(crypto.HashSize), 100, crypto.CRandBytes(crypto.HashSize))
}
func makeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) types.BlockID {
var (
h = make([]byte, tmhash.Size)
psH = make([]byte, tmhash.Size)
h = make([]byte, crypto.HashSize)
psH = make([]byte, crypto.HashSize)
)
copy(h, hash)
copy(psH, partSetHash)