Skip to content

Commit 6a951e6

Browse files
authored
Merge pull request #2084 from CosmWasm/mergify/bp/release/2.0/pr-2083
Add `CosmosMsg::Stargate` case back (backport #2083)
2 parents 7915835 + 2530503 commit 6a951e6

File tree

8 files changed

+168
-0
lines changed

8 files changed

+168
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ and this project adheres to
1010

1111
- cosmwasm-std: Correctly deallocate vectors that were turned into a `Region`
1212
via `release_buffer` ([#2062])
13+
- cosmwasm-std: Add back `CosmosMsg::Stargate` case to support new contracts on
14+
chains with older CosmWasm versions. ([#2083])
1315

1416
[#2062]: https://github.com/CosmWasm/cosmwasm/pull/2062
17+
[#2083]: https://github.com/CosmWasm/cosmwasm/pull/2083
1518

1619
## [2.0.0] - 2024-03-12
1720

contracts/ibc-reflect-send/schema/ibc-reflect-send.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,32 @@
240240
},
241241
"additionalProperties": false
242242
},
243+
{
244+
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
245+
"deprecated": true,
246+
"type": "object",
247+
"required": [
248+
"stargate"
249+
],
250+
"properties": {
251+
"stargate": {
252+
"type": "object",
253+
"required": [
254+
"type_url",
255+
"value"
256+
],
257+
"properties": {
258+
"type_url": {
259+
"type": "string"
260+
},
261+
"value": {
262+
"$ref": "#/definitions/Binary"
263+
}
264+
}
265+
}
266+
},
267+
"additionalProperties": false
268+
},
243269
{
244270
"type": "object",
245271
"required": [

contracts/ibc-reflect-send/schema/ibc/packet_msg.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,32 @@
178178
},
179179
"additionalProperties": false
180180
},
181+
{
182+
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
183+
"deprecated": true,
184+
"type": "object",
185+
"required": [
186+
"stargate"
187+
],
188+
"properties": {
189+
"stargate": {
190+
"type": "object",
191+
"required": [
192+
"type_url",
193+
"value"
194+
],
195+
"properties": {
196+
"type_url": {
197+
"type": "string"
198+
},
199+
"value": {
200+
"$ref": "#/definitions/Binary"
201+
}
202+
}
203+
}
204+
},
205+
"additionalProperties": false
206+
},
181207
{
182208
"type": "object",
183209
"required": [

contracts/ibc-reflect-send/schema/raw/execute.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,32 @@
229229
},
230230
"additionalProperties": false
231231
},
232+
{
233+
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
234+
"deprecated": true,
235+
"type": "object",
236+
"required": [
237+
"stargate"
238+
],
239+
"properties": {
240+
"stargate": {
241+
"type": "object",
242+
"required": [
243+
"type_url",
244+
"value"
245+
],
246+
"properties": {
247+
"type_url": {
248+
"type": "string"
249+
},
250+
"value": {
251+
"$ref": "#/definitions/Binary"
252+
}
253+
}
254+
}
255+
},
256+
"additionalProperties": false
257+
},
232258
{
233259
"type": "object",
234260
"required": [

contracts/ibc-reflect/schema/ibc/packet_msg.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,32 @@
230230
},
231231
"additionalProperties": false
232232
},
233+
{
234+
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
235+
"deprecated": true,
236+
"type": "object",
237+
"required": [
238+
"stargate"
239+
],
240+
"properties": {
241+
"stargate": {
242+
"type": "object",
243+
"required": [
244+
"type_url",
245+
"value"
246+
],
247+
"properties": {
248+
"type_url": {
249+
"type": "string"
250+
},
251+
"value": {
252+
"$ref": "#/definitions/Binary"
253+
}
254+
}
255+
}
256+
},
257+
"additionalProperties": false
258+
},
233259
{
234260
"description": "`CosmosMsg::Any` is the replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is suppored by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
235261
"type": "object",

contracts/reflect/schema/raw/execute.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,32 @@
215215
},
216216
"additionalProperties": false
217217
},
218+
{
219+
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
220+
"deprecated": true,
221+
"type": "object",
222+
"required": [
223+
"stargate"
224+
],
225+
"properties": {
226+
"stargate": {
227+
"type": "object",
228+
"required": [
229+
"type_url",
230+
"value"
231+
],
232+
"properties": {
233+
"type_url": {
234+
"type": "string"
235+
},
236+
"value": {
237+
"$ref": "#/definitions/Binary"
238+
}
239+
}
240+
}
241+
},
242+
"additionalProperties": false
243+
},
218244
{
219245
"description": "`CosmosMsg::Any` is the replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is suppored by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
220246
"type": "object",

contracts/reflect/schema/reflect.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,32 @@
225225
},
226226
"additionalProperties": false
227227
},
228+
{
229+
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
230+
"deprecated": true,
231+
"type": "object",
232+
"required": [
233+
"stargate"
234+
],
235+
"properties": {
236+
"stargate": {
237+
"type": "object",
238+
"required": [
239+
"type_url",
240+
"value"
241+
],
242+
"properties": {
243+
"type_url": {
244+
"type": "string"
245+
},
246+
"value": {
247+
"$ref": "#/definitions/Binary"
248+
}
249+
}
250+
}
251+
},
252+
"additionalProperties": false
253+
},
228254
{
229255
"description": "`CosmosMsg::Any` is the replaces the \"stargate message\" – a message wrapped in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any) that is suppored by the chain. It behaves the same as `CosmosMsg::Stargate` but has a better name and slightly improved syntax.\n\nThis is feature-gated at compile time with `cosmwasm_2_0` because a chain running CosmWasm < 2.0 cannot process this.",
230256
"type": "object",

packages/std/src/results/cosmos_msg.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
use core::fmt;
24
use derivative::Derivative;
35
use schemars::JsonSchema;
@@ -34,6 +36,13 @@ pub enum CosmosMsg<T = Empty> {
3436
Staking(StakingMsg),
3537
#[cfg(feature = "staking")]
3638
Distribution(DistributionMsg),
39+
/// This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)
40+
#[cfg(feature = "stargate")]
41+
#[deprecated = "Use `CosmosMsg::Any` instead (if you only target CosmWasm 2+ chains)"]
42+
Stargate {
43+
type_url: String,
44+
value: Binary,
45+
},
3746
/// `CosmosMsg::Any` is the replaces the "stargate message" – a message wrapped
3847
/// in a [protobuf Any](https://protobuf.dev/programming-guides/proto3/#any)
3948
/// that is suppored by the chain. It behaves the same as

0 commit comments

Comments
 (0)