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

Enhance multi test #257

Merged
merged 2 commits into from
Apr 1, 2021
Merged

Enhance multi test #257

merged 2 commits into from
Apr 1, 2021

Conversation

ethanfrey
Copy link
Member

Make this compatible with more advanced workflows

  • Support returning Response with custom message (this was a TODO)
  • Add support for contract wrappers with sudo entrypoint

TODO (other PR?)

  • Expose sudo on top level
  • Add support for reply entry point
  • Process submessages in app and pass response into reply

@ethanfrey
Copy link
Member Author

I'm going to merge and tag this to unblock some work, and add the other items in a future PR.

@ethanfrey ethanfrey merged commit 96f4bb2 into master Apr 1, 2021
@ethanfrey ethanfrey deleted the enhance-multi-test branch April 1, 2021 13:29
@ethanfrey
Copy link
Member Author

Okay, I made a 0.6.0-alpha2 release with this and got one step further. Now the issue is:

 --> contracts/tgrade-valset/src/contract.rs:423:40
    |
423 |         let valset_id = app.store_code(contract_valset());
    |                                        ^^^^^^^^^^^^^^^^^ expected struct `cosmwasm_std::Empty`, found enum `tgrade_bindings::TgradeMsg`
    |
    = note: expected struct `Box<(dyn Contract + 'static)>`
               found struct `Box<(dyn Contract<tgrade_bindings::TgradeMsg> + 'static)>`

So, I guess and app must accept only contracts that are Contract<C> with the same C. We assume there is only one custom message type on the chain, so in general this is good, but we must support Contract<Empty> as well.

So, basically, we will need to store &dyn Contract<C> in the app, but the contract wrapper should be able to accept functions that return Response<Empty> and convert it to Response<C> to handle this.

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.

1 participant