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

Create execution helpers #130

Open
6 tasks
hashedone opened this issue May 24, 2023 · 0 comments
Open
6 tasks

Create execution helpers #130

hashedone opened this issue May 24, 2023 · 0 comments
Labels
backlog Items planned to be done, but with no milestone yet enhancement New feature or request requested
Milestone

Comments

@hashedone
Copy link
Collaborator

hashedone commented May 24, 2023

Very similar to query helpers described in #28, but this time for helping execution.

The executor helpers should provide functions returning prepared CosmosMsg or SubMsg.

The executor would be a trait generated from interfaces/contracts and implemented probably directly on the Remote struct (unless some additional data would be needed there, like QuerierWrapper for queries). Single executor keeps all the exec functions callable on the contract, with signatures similar to those in mt helpers.

Similarly, as in MT helpers, it would give back the #[must_use] proxy type, which would use a builder pattern to provide metadata - I think only the funds field would be addable to create a simple message, but it should also contain the reply_on function:

fn reply_on(self, reply_on: cosmwasm_std::ReplyOn, reply_id: u64) -> ...;

Which returns another proxy object (let's call it submsg proxy for now), building SubMsg instead of Msg - any non-sub-msg fields (funds in particular) should be set before calling the reply_on.

Both execution proxy and submsg proxy should contain a fn message(self) -> ... function (not call() like in mt - call is not happening at this point), which returns a message to be passed into Response::add_message() or Response::add_submessage(). I would also opt for adding a fn schedule(self, response: Response) -> Response immediately adding the message into the response, which sometimes might be a shortcut.

@hashedone hashedone added enhancement New feature or request requested labels Jun 9, 2023
@hashedone hashedone added the backlog Items planned to be done, but with no milestone yet label Feb 26, 2024
@hashedone hashedone added this to the 1.2.0 milestone May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Items planned to be done, but with no milestone yet enhancement New feature or request requested
Projects
None yet
Development

No branches or pull requests

1 participant