Skip to content

Commit

Permalink
Fix tiny x/mock issue from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes committed Sep 12, 2018
1 parent c749791 commit c16f33f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions x/mock/simulation/random_simulate_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func SimulateFromSeed(
request = RandomRequestBeginBlock(r, validators, livenessTransitionMatrix, evidenceFraction, pastTimes, pastSigningValidators, event, header)

// Update the validator set
validators = updateValidators(tb, r, log, validators, res.ValidatorUpdates, event)
validators = updateValidators(tb, r, validators, res.ValidatorUpdates, event)
}
if stopEarly {
DisplayEvents(events)
Expand Down Expand Up @@ -340,15 +340,14 @@ func RandomRequestBeginBlock(r *rand.Rand, validators map[string]mockValidator,
}

// updateValidators mimicks Tendermint's update logic
func updateValidators(
tb testing.TB, r *rand.Rand, log string, current map[string]mockValidator,
updates []abci.Validator, event func(string)) map[string]mockValidator {
// nolint: unparam
func updateValidators(tb testing.TB, r *rand.Rand, current map[string]mockValidator, updates []abci.Validator, event func(string)) map[string]mockValidator {

for _, update := range updates {
switch {
case update.Power == 0:
if _, ok := current[string(update.PubKey.Data)]; !ok {
tb.Fatalf("tried to delete a nonexistent validator: %v", log)
tb.Fatalf("tried to delete a nonexistent validator")
}

event("endblock/validatorupdates/kicked")
Expand Down

0 comments on commit c16f33f

Please sign in to comment.