evidence: check lunatic vote matches header (#5093)

This commit is contained in:
Callum Waters
2020-07-08 17:58:03 +02:00
committed by GitHub
parent 66ed8ec39d
commit a97d05be4d
3 changed files with 59 additions and 11 deletions

View File

@@ -587,7 +587,13 @@ func TestVerifyEvidenceWithLunaticValidatorEvidence(t *testing.T) {
EvidenceHash: tmhash.Sum([]byte("evidence_hash")),
ProposerAddress: crypto.AddressHash([]byte("proposer_address")),
}
vote := makeVote(3, 1, 0, addr, blockID)
vote := makeVote(3, 1, 0, addr, types.BlockID{
Hash: h.Hash(),
PartSetHeader: types.PartSetHeader{
Total: 100,
Hash: crypto.CRandBytes(tmhash.Size),
},
})
v := vote.ToProto()
err := vals[val.Address.String()].SignVote(chainID, v)
vote.Signature = v.Signature