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

Generic module types #425

Merged
merged 10 commits into from
Sep 19, 2021
Merged

Generic module types #425

merged 10 commits into from
Sep 19, 2021

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Sep 15, 2021

Closes #387

Start work on generic modules.

  • Define a Module type generic of any Msg, Query
  • Implement this for Bank
  • Do all initialisation on App::build()
  • Simplify Apis, eg. using Bank = Module<BankMsg, BankQuery> alias
  • Contract tests pass
  • Use this for CustomHandler
  • Add Panicking implementations for Staking, Distribution

TODO in a future PR:

  • Use Module for WasmHandler (this is a bit too central and too many special entry-points - we need to expose Sudo somehow)
  • Clean up APIs some more (with usage)

@ethanfrey ethanfrey marked this pull request as draft September 15, 2021 15:29
@ethanfrey ethanfrey marked this pull request as ready for review September 15, 2021 21:24
@ethanfrey ethanfrey requested a review from hashedone September 15, 2021 21:30
Copy link
Contributor

@hashedone hashedone left a comment

Choose a reason for hiding this comment

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

Seems good, except now we should implement proper staking and distribution modules, as they probably should not fail by default for wasm.

@ethanfrey
Copy link
Member Author

Seems good, except now we should implement proper staking and distribution modules, as they probably should not fail by default for wasm.

Yeah, that can be another PR. In 0.10.1 or later.

Honestly, I would add that in a contract that needs it and then port it to cw-plus. But this is more important for Terra than us I believe. Now they have hooks to add it.

@ethanfrey ethanfrey merged commit 0850aa1 into main Sep 19, 2021
@ethanfrey ethanfrey deleted the generic-module-types branch September 19, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define generic multitest module
2 participants