Skip to content

Commit

Permalink
Use current validators when selected
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes committed Aug 27, 2018
1 parent 97cdfd8 commit 527bbbd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions x/mock/simulation/random_simulate_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 527bbbd

Please sign in to comment.