From 4526bef621adef9fbb7fa0e5a39e364bdfb1012f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 18:00:42 +0200 Subject: [PATCH] feat: add moduleStateCb to allow access moduleState in sim test (backport #15903) (#15925) Co-authored-by: mmsqe Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + types/simulation/types.go | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c5c0ebefb2..8b46ad37fb37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/types/simulation/types.go b/types/simulation/types.go index 4759bba8e58c..942341ec3a8f 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -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