Skip to content

Commit

Permalink
feat: add moduleStateCb to allow access moduleState in sim test (back…
Browse files Browse the repository at this point in the history
…port cosmos#15903) (cosmos#15925)

Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people authored and JeancarloBarrios committed Sep 28, 2024
1 parent 05fc156 commit 4526bef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

* (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has.
* (simapp) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. Note, this function is present in simtestutil from `v0.47.2+`.

### Bug Fixes

Expand Down
5 changes: 2 additions & 3 deletions types/simulation/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ type AppStateFn func(r *rand.Rand, accs []Account, config Config) (
)

// AppStateFnWithExtendedCb returns the app state json bytes and the genesis accounts
type AppStateFnWithExtendedCb func(r *rand.Rand, accs []Account, config Config) (
appState json.RawMessage, accounts []Account, chainId string, genesisTimestamp time.Time,
)
// Deprecated: Use AppStateFn instead. This will be removed in a future relase.
type AppStateFnWithExtendedCb AppStateFn

// RandomAccountFn returns a slice of n random simulation accounts
type RandomAccountFn func(r *rand.Rand, n int) []Account
Expand Down

0 comments on commit 4526bef

Please sign in to comment.