Skip to content

Commit 6114116

Browse files
authored
Merge pull request #2334 from CosmWasm/co/update-events-docs
Update SubMsgResponse docs
2 parents 9ade6e1 + a6bbd66 commit 6114116

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

contracts/reflect/schema/raw/response_to_sub_msg_result.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"additionalProperties": false
9797
},
9898
"SubMsgResponse": {
99-
"description": "The information we get back from a successful sub message execution, with full Cosmos SDK events.",
99+
"description": "The information we get back from a successful sub message execution",
100100
"type": "object",
101101
"required": [
102102
"events"
@@ -114,6 +114,7 @@
114114
]
115115
},
116116
"events": {
117+
"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",
117118
"type": "array",
118119
"items": {
119120
"$ref": "#/definitions/Event"

contracts/reflect/schema/reflect.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2295,7 +2295,7 @@
22952295
"additionalProperties": false
22962296
},
22972297
"SubMsgResponse": {
2298-
"description": "The information we get back from a successful sub message execution, with full Cosmos SDK events.",
2298+
"description": "The information we get back from a successful sub message execution",
22992299
"type": "object",
23002300
"required": [
23012301
"events"
@@ -2313,6 +2313,7 @@
23132313
]
23142314
},
23152315
"events": {
2316+
"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",
23162317
"type": "array",
23172318
"items": {
23182319
"$ref": "#/definitions/Event"

packages/std/src/results/submessages.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,16 @@ impl From<SubMsgResult> for Result<SubMsgResponse, String> {
280280
}
281281
}
282282

283-
/// The information we get back from a successful sub message execution,
284-
/// with full Cosmos SDK events.
283+
/// The information we get back from a successful sub message execution
285284
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
286285
pub struct SubMsgResponse {
286+
/// The Cosmos SDK events emitted by the submessage.
287+
///
288+
/// This is only filled if the submessage was itself a [`crate::WasmMsg`].
289+
/// The reason for this is that events are [not part of consensus] and therefore not guaranteed to be deterministic,
290+
/// so the VM only returns events of wasm messages, which we know are deterministic.
291+
///
292+
/// [not part of consensus]: https://github.com/tendermint/tendermint/blob/eed27addecb339cfaeba8fda774e6ab37cdb3774/spec/abci/abci.md#events
287293
pub events: Vec<Event>,
288294
#[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."]
289295
pub data: Option<Binary>,

0 commit comments

Comments
 (0)