use correct source of evidence time

Conflicting votes are now sent to the evidence pool to form duplicate vote evidence only once
the height of the evidence is finished and the time of the block finalised.
This commit is contained in:
Callum
2021-01-19 16:00:02 +01:00
committed by Tess Rinearson
parent 62d7a5d028
commit af723eca8a
7 changed files with 203 additions and 90 deletions
+1 -2
View File
@@ -266,8 +266,7 @@ func TestCreateProposalBlock(t *testing.T) {
for currentBytes <= maxEvidenceBytes {
ev := types.NewMockDuplicateVoteEvidenceWithValidator(height, time.Now(), privVals[0], "test-chain")
currentBytes += int64(len(ev.Bytes()))
err := evidencePool.AddEvidenceFromConsensus(ev)
require.NoError(t, err)
evidencePool.ReportConflictingVotes(ev.VoteA, ev.VoteB)
}
evList, size := evidencePool.PendingEvidence(state.ConsensusParams.Evidence.MaxBytes)