TMHASH is 32 bytes. Closes #1990 (#2732)

* tmhash is fully 32 bytes. closes #1990

* AddressSize

* fix tests

* fix max sizes
This commit is contained in:
Ethan Buchman
2018-10-31 12:42:05 -04:00
committed by GitHub
parent 1660e30ffe
commit a22c962e28
16 changed files with 96 additions and 51 deletions

View File

@ -77,15 +77,15 @@ func (v *Validator) Hash() []byte {
}
// Bytes computes the unique encoding of a validator with a given voting power.
// These are the bytes that gets hashed in consensus. It excludes pubkey
// as its redundant with the address. This also excludes accum which changes
// These are the bytes that gets hashed in consensus. It excludes address
// as its redundant with the pubkey. This also excludes accum which changes
// every round.
func (v *Validator) Bytes() []byte {
return cdcEncode((struct {
Address Address
PubKey crypto.PubKey
VotingPower int64
}{
v.Address,
v.PubKey,
v.VotingPower,
}))
}