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 dedicated SubMsgResult #1232

Merged
merged 4 commits into from
Mar 1, 2022
Merged

Create dedicated SubMsgResult #1232

merged 4 commits into from
Mar 1, 2022

Conversation

webmaster128
Copy link
Member

This change completents CosmWasm/wasmd#765 in the sense that it makes clear this is the result of an arbitrary Cosmos SDK message execution and not restricted to contract calls.

Once serialized, the new type SubMsgResult looks the same as ContractResult<SubMsgExecutionResponse>. However, ContractResult is documented to be the result of a contract execution. So the way it was used here before is confusing, especially when comparing it with the query result QuerierResult = SystemResult<ContractResult<Binary>> where there actually is a contract execution result involved (for some queries).

The corresponding wasmvm type is SubcallResult.

This is slightly code breaking, but the JSON interface does not change and SubMsgResult has the same methods as ContractResult.

@@ -100,12 +100,216 @@ pub struct Reply {
/// The ID that the contract set when emitting the `SubMsg`.
/// Use this to identify which submessage triggered the `reply`.
pub id: u64,
pub result: ContractResult<SubMsgExecutionResponse>,
pub result: SubMsgResult,
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is the core of this PR.

@webmaster128 webmaster128 force-pushed the SubMsgResult branch 2 times, most recently from f98ac72 to b9d825d Compare February 25, 2022 08:25
@webmaster128 webmaster128 marked this pull request as ready for review March 1, 2022 11:37
@webmaster128 webmaster128 merged commit 13a04e2 into main Mar 1, 2022
@webmaster128 webmaster128 deleted the SubMsgResult branch March 1, 2022 14:04
crnch pushed a commit to crnch/cw-template that referenced this pull request Mar 13, 2022
Changed API in updated dependencies lead to failing (unit) tests.
Fixed by updating crate versions.

CosmWasm/cosmwasm#1232
CosmWasm#106
orkunkl pushed a commit to CosmWasm/cw-template that referenced this pull request Mar 13, 2022
Changed API in updated dependencies lead to failing (unit) tests.
Fixed by updating crate versions.

CosmWasm/cosmwasm#1232
#106
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.

None yet

1 participant