evidence: fix usage of time field in abci evidence (#5201)

* fix usage of time in abci evidence

* update changelong and upgrading

* add test cases
This commit is contained in:
Callum Waters
2020-08-04 12:58:48 +02:00
committed by GitHub
parent ad2e515112
commit 68468fb024
6 changed files with 20 additions and 13 deletions
+1 -1
View File
@@ -360,7 +360,7 @@ func getBeginBlockValidatorInfo(block *types.Block, stateDB dbm.DB) (abci.LastCo
if err != nil {
panic(err)
}
byzVals[i] = types.TM2PB.Evidence(ev, valset, block.Time)
byzVals[i] = types.TM2PB.Evidence(ev, valset)
}
return abci.LastCommitInfo{
+3 -3
View File
@@ -140,10 +140,10 @@ func TestBeginBlockByzantineValidators(t *testing.T) {
expectedByzantineValidators []abci.Evidence
}{
{"none byzantine", []types.Evidence{}, []abci.Evidence{}},
{"one byzantine", []types.Evidence{ev1}, []abci.Evidence{types.TM2PB.Evidence(ev1, valSet, now)}},
{"one byzantine", []types.Evidence{ev1}, []abci.Evidence{types.TM2PB.Evidence(ev1, valSet)}},
{"multiple byzantine", []types.Evidence{ev1, ev2}, []abci.Evidence{
types.TM2PB.Evidence(ev1, valSet, now),
types.TM2PB.Evidence(ev2, valSet, now)}},
types.TM2PB.Evidence(ev1, valSet),
types.TM2PB.Evidence(ev2, valSet)}},
}
var (