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

Update SubMsgResponse docs #2334

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/reflect/schema/raw/response_to_sub_msg_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"additionalProperties": false
},
"SubMsgResponse": {
"description": "The information we get back from a successful sub message execution, with full Cosmos SDK events.",
"description": "The information we get back from a successful sub message execution",
"type": "object",
"required": [
"events"
Expand All @@ -114,6 +114,7 @@
]
},
"events": {
"description": "The Cosmos SDK events emitted by the submessage.\n\nThis is only filled if the submessage was itself a [`crate::WasmMsg`]. The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic, so the VM only returns events of wasm messages, which we know are deterministic.\n\n[not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events",
"type": "array",
"items": {
"$ref": "#/definitions/Event"
Expand Down
3 changes: 2 additions & 1 deletion contracts/reflect/schema/reflect.json
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@
"additionalProperties": false
},
"SubMsgResponse": {
"description": "The information we get back from a successful sub message execution, with full Cosmos SDK events.",
"description": "The information we get back from a successful sub message execution",
"type": "object",
"required": [
"events"
Expand All @@ -2313,6 +2313,7 @@
]
},
"events": {
"description": "The Cosmos SDK events emitted by the submessage.\n\nThis is only filled if the submessage was itself a [`crate::WasmMsg`]. The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic, so the VM only returns events of wasm messages, which we know are deterministic.\n\n[not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events",
"type": "array",
"items": {
"$ref": "#/definitions/Event"
Expand Down
10 changes: 8 additions & 2 deletions packages/std/src/results/submessages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,16 @@ impl From<SubMsgResult> for Result<SubMsgResponse, String> {
}
}

/// The information we get back from a successful sub message execution,
/// with full Cosmos SDK events.
/// The information we get back from a successful sub message execution
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct SubMsgResponse {
/// The Cosmos SDK events emitted by the submessage.
///
/// This is only filled if the submessage was itself a [`crate::WasmMsg`].
/// The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic,
/// so the VM only returns events of wasm messages, which we know are deterministic.
///
/// [not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events
pub events: Vec<Event>,
#[deprecated = "Deprecated in the Cosmos SDK in favor of msg_responses. If your chain is running on CosmWasm 2.0 or higher, msg_responses will be filled. For older versions, the data field is still needed since msg_responses is empty in those cases."]
pub data: Option<Binary>,
Expand Down
Loading