Skip to content

Commit

Permalink
fix(sims): Skip sims test when running dry on validators (#21906)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3856e77)
  • Loading branch information
alpe authored and mergify[bot] committed Sep 25, 2024
1 parent 9923c45 commit ab61d70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (runtime) [#21704](https://github.com/cosmos/cosmos-sdk/pull/21704) Move `upgradetypes.StoreLoader` to runtime and alias it in upgrade for backward compatibility.
* (sims)[#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules

* (sims) [21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators

### API Breaking Changes

* (types/mempool) [#21744](https://github.com/cosmos/cosmos-sdk/pull/21744) Update types/mempool.Mempool interface to take decoded transactions. This avoid to decode the transaction twice.
Expand Down
8 changes: 8 additions & 0 deletions x/simulation/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ func SimulateFromSeedX(
return blockedAddrs[acc.AddressBech32]
})
nextValidators := validators
if len(nextValidators) == 0 {
tb.Skip("skipping: empty validator set in genesis")
return params, accs, nil
}

var (
pastTimes []time.Time
Expand Down Expand Up @@ -264,6 +268,10 @@ func SimulateFromSeedX(
// on the next block
validators = nextValidators
nextValidators = updateValidators(tb, r, params, validators, res.ValidatorUpdates, eventStats.Tally)
if len(nextValidators) == 0 {
tb.Skip("skipping: empty validator set")
return exportedParams, accs, err
}

// update the exported params
if config.ExportParamsPath != "" && int64(config.ExportParamsHeight) == blockHeight {
Expand Down

0 comments on commit ab61d70

Please sign in to comment.