Skip to content

Commit

Permalink
Merge pull request #2334 from CosmWasm/co/update-events-docs
Browse files Browse the repository at this point in the history
Update SubMsgResponse docs
  • Loading branch information
chipshort authored Jan 10, 2025
2 parents 9ade6e1 + a6bbd66 commit 6114116
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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

0 comments on commit 6114116

Please sign in to comment.