mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 22:23:11 +00:00
fix assertions on byzantine test (#5171)
This commit is contained in:
@@ -167,13 +167,14 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
|
||||
msg := <-blocksSubs[j].Out()
|
||||
block := msg.Data().(types.EventDataNewBlock).Block
|
||||
// assert that we have evidence
|
||||
require.True(t, len(block.Evidence.Evidence) == 1)
|
||||
// and that the evidence is of type DuplicateVoteEvidence
|
||||
ev, ok := block.Evidence.Evidence[0].(*types.DuplicateVoteEvidence)
|
||||
assert.True(t, ok)
|
||||
// and that the address matches to that of the byzantine node
|
||||
pubkey, _ := bcs.privValidator.GetPubKey()
|
||||
assert.Equal(t, []byte(pubkey.Address()), ev.Address())
|
||||
if assert.True(t, len(block.Evidence.Evidence) == 1) {
|
||||
// and that the evidence is of type DuplicateVoteEvidence
|
||||
ev, ok := block.Evidence.Evidence[0].(*types.DuplicateVoteEvidence)
|
||||
assert.True(t, ok)
|
||||
// and that the address matches to that of the byzantine node
|
||||
pubkey, _ := bcs.privValidator.GetPubKey()
|
||||
assert.Equal(t, []byte(pubkey.Address()), ev.Address())
|
||||
}
|
||||
}, css)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user