Browse Source

fix assertions on byzantine test (#5171)

pull/5176/head
Callum Waters 4 years ago
committed by GitHub
parent
commit
77429b71d6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      consensus/byzantine_test.go

+ 8
- 7
consensus/byzantine_test.go View File

@ -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)
}


Loading…
Cancel
Save