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-13 19:21:25 +01:00
committed by Tess Rinearson
parent 7ea4dc52ed
commit a2a6852ab9
7 changed files with 205 additions and 96 deletions

View File

@@ -265,8 +265,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)