From 527bbbd478361caa60535400e6ccec0eb581fc73 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Mon, 27 Aug 2018 20:12:40 +0200 Subject: [PATCH] Use current validators when selected --- x/mock/simulation/random_simulate_blocks.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/mock/simulation/random_simulate_blocks.go b/x/mock/simulation/random_simulate_blocks.go index adeec4163deb..05b1c8a734f1 100644 --- a/x/mock/simulation/random_simulate_blocks.go +++ b/x/mock/simulation/random_simulate_blocks.go @@ -186,14 +186,15 @@ func RandomRequestBeginBlock(t *testing.T, r *rand.Rand, validators map[string]m for r.Float64() < evidenceFraction { height := header.Height time := header.Time + vals := signingValidators if r.Float64() < pastEvidenceFraction { height = int64(r.Intn(int(header.Height))) time = pastTimes[height] + vals = pastSigningValidators[height] } - past := pastSigningValidators[height] - validator := past[r.Intn(len(past))].Validator + validator := vals[r.Intn(len(vals))].Validator var totalVotingPower int64 - for _, val := range past { + for _, val := range vals { totalVotingPower += val.Validator.Power } evidence = append(evidence, abci.Evidence{