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

Confusion between semantics documentation and Response type #1514

Open
0xekez opened this issue Nov 24, 2022 · 0 comments
Open

Confusion between semantics documentation and Response type #1514

0xekez opened this issue Nov 24, 2022 · 0 comments

Comments

@0xekez
Copy link
Contributor

0xekez commented Nov 24, 2022

the CosmWasm semantics document says

Submessages (and their replies) are all executed before any messages

and gives an example:

Contract A returns submessages S1 and S2, and message M1

I think the "feeling" that this semantics document gives then is that when I call Response::add_submessages, these will be executed before messages I add with Response::add_messages. peeking inside of those methods though, the response type only has one message list, and says that those messages will get executed in order:

    /// Optional list of messages to pass. These will be executed in order.
    /// If the ReplyOn variant matches the result (Always, Success on Ok, Error on Err),
    /// the runtime will invoke this contract's `reply` entry point
    /// after execution. Otherwise, they act like "fire and forget".
    /// Use `SubMsg::new` to create messages with the older "fire and forget" semantics.
    pub messages: Vec<SubMsg<T>>,

which makes me think that is not the case, as both calls append to this list. it would be great to get some clarification on what the actual rules are here.

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

No branches or pull requests

1 participant