Sync Vote.Verify() in spec with implementation (#9466) (#9476)

This commit is contained in:
mergify[bot]
2022-09-21 22:35:16 -04:00
committed by GitHub
parent b2b3f47e08
commit 3545d1e835

View File

@@ -269,8 +269,8 @@ func (vote *Vote) Verify(chainID string, pubKey crypto.PubKey) error {
if !bytes.Equal(pubKey.Address(), vote.ValidatorAddress) {
return ErrVoteInvalidValidatorAddress
}
if !pubKey.VerifyBytes(types.VoteSignBytes(chainID), vote.Signature) {
v := vote.ToProto()
if !pubKey.VerifyBytes(types.VoteSignBytes(chainID, v), vote.Signature) {
return ErrVoteInvalidSignature
}
return nil