Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract AppStateFn out of simapp #14971

Closed
gjermundgaraba opened this issue Feb 9, 2023 · 1 comment · Fixed by #14977
Closed

Extract AppStateFn out of simapp #14971

gjermundgaraba opened this issue Feb 9, 2023 · 1 comment · Fixed by #14977
Assignees

Comments

@gjermundgaraba
Copy link
Contributor

gjermundgaraba commented Feb 9, 2023

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"
)

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Feb 9, 2023
@tac0turtle tac0turtle added C:Simulations T:Sprint and removed needs-triage Issue that needs to be triaged labels Feb 9, 2023
@julienrbrt
Copy link
Member

julienrbrt commented Feb 9, 2023

Good point! I see it depends solely on the genesisState, so that is easily extractable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants