evidence: replace mock evidence with mocked duplicate vote evidence (#5036)

This commit is contained in:
Callum Waters
2020-06-24 07:24:30 +02:00
committed by GitHub
parent a2284b8533
commit 3ecc0ffe7e
12 changed files with 199 additions and 1034 deletions
+3 -5
View File
@@ -154,9 +154,7 @@ func TestReactorWithEvidence(t *testing.T) {
// mock the evidence pool
// everyone includes evidence of another double signing
vIdx := (i + 1) % nValidators
pubKey, err := privVals[vIdx].GetPubKey()
require.NoError(t, err)
evpool := newMockEvidencePool(pubKey.Address())
evpool := newMockEvidencePool(privVals[vIdx])
// Make State
blockExec := sm.NewBlockExecutor(stateDB, log.TestingLogger(), proxyAppConnCon, mempool, evpool)
@@ -201,9 +199,9 @@ type mockEvidencePool struct {
ev []types.Evidence
}
func newMockEvidencePool(val []byte) *mockEvidencePool {
func newMockEvidencePool(val types.PrivValidator) *mockEvidencePool {
return &mockEvidencePool{
ev: []types.Evidence{types.NewMockEvidence(1, time.Now().UTC(), val)},
ev: []types.Evidence{types.NewMockDuplicateVoteEvidenceWithValidator(1, time.Now().UTC(), val, config.ChainID())},
}
}