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

De-duplicate sim module setup #1664

Merged
merged 3 commits into from
Jun 20, 2022
Merged

De-duplicate sim module setup #1664

merged 3 commits into from
Jun 20, 2022

Conversation

ValarDragon
Copy link
Member

What is the purpose of the change

The simulation module setup code is an unnecessary large duplication of logic. This PR makes it get most of the simulation modules from run-time type casting, and allowing overrides where necessary.

This should ideally be upstreamed to the SDK, and then be a really simple helper method we call.

Brief Changelog

  • De-duplicate logic in simulation module setup

Testing and Verifying

This change is a minor rework. Also not that impactful, as we don't really use the simulator within osmosis.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? no
  • How is the feature or change documented? not applicable

@ValarDragon ValarDragon requested a review from a team June 3, 2022 19:01
@github-actions github-actions bot added the C:app-wiring Changes to the app folder label Jun 3, 2022
app/modules.go Show resolved Hide resolved
),
app.TransferModule,
// recreate list of modules, to ensure no issues with overriding prior module structs.
modules := appModules(app, encodingConfig, skipGenesisInvariants)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the modules returned from appModules is different from the existing modules that were hard coded? Is this change intended / is there context that I missed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prior ones that weren't here were just forgotten tbh, because this was too much of a pain to maintain

app/modules.go Outdated Show resolved Hide resolved
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
@ValarDragon ValarDragon merged commit 3eeeade into main Jun 20, 2022
@ValarDragon ValarDragon deleted the dev/cleanup_sim_modules branch June 20, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:app-wiring Changes to the app folder
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants