Skip to content

Extract AppStateFn out of simapp #14971

@gjermundgaraba

Description

@gjermundgaraba

Summary

Extract AppStateFn out of simapp and into testutils (or where it might belong).

Problem Definition

When setting up simulations, this function is needed. It is not clear to me, at least, if there is always a need to write your own version of this.

It seems like most other projects either:

  • Depend on simapp (like regen-ledger)
  • Have a copy of AppStateFn from simapp in their own code (like crypto.com)

This was mentioned here: #13379 (comment)

AppStateFn is not extracted, as it is very dependent on simapp (at least on simapp/params). I think each app should have theirs, right? Osmosis has theirs, Crypto.com too f.e.

It looks like the crypto.com one is just a copy of the simapp one.
But perhaps more importantly, I don't think it needs to be dependent on simapp params. It only depends on it because of two constants that are declared there, but used nowhere else.

// Simulation parameter constants
const (
StakePerAccount = "stake_per_account"
InitiallyBondedValidators = "initially_bonded_validators"
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions