Skip to content

Commit

Permalink
Merge branch 'main' into facu/fup-multisig-gomod
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica committed Jul 12, 2024
2 parents 8a37b7e + dc5c16b commit f209ed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions baseapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ func (app *BaseApp) SimDeliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo,
return gasInfo, result, err
}

// SimWriteState is an entrypoint for simulations only. They are not executed during the normal ABCI finalize
// block step but later. Therefor an extra call to the root multi-store (app.cms) is required to write the changes.
func (app *BaseApp) SimWriteState() {
app.finalizeBlockState.ms.Write()
}

// NewContextLegacy returns a new sdk.Context with the provided header
func (app *BaseApp) NewContextLegacy(isCheckTx bool, header cmtproto.Header) sdk.Context {
if isCheckTx {
Expand Down
1 change: 1 addition & 0 deletions x/simulation/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func SimulateFromSeedX(
proposerAddress = validators.randomProposer(r)

if config.Commit {
app.SimWriteState()
if _, err := app.Commit(); err != nil {
return params, fmt.Errorf("commit failed at height %d: %w", blockHeight, err)
}
Expand Down

0 comments on commit f209ed9

Please sign in to comment.