Skip to content

Commit a330756

Browse files
committed
Split StakingMsg::Withdraw
1 parent 09d800b commit a330756

File tree

10 files changed

+351
-157
lines changed

10 files changed

+351
-157
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ and this project adheres to
164164
([#802]).
165165
- cosmwasm-std: Hide `StakingMsg` and `CosmosMsg::Staking` behind the `staking`
166166
feature flag to make those only available in contracts built for PoS chains.
167+
- cosmwasm-std: Remove `StakingMsg::Withdraw` in favour of
168+
`DistributionMsg::SetWithdrawAddress` and
169+
`DistributionMsg::WithdrawDelegatorReward` ([#848]).
167170

168171
[#696]: https://github.com/CosmWasm/cosmwasm/issues/696
169172
[#697]: https://github.com/CosmWasm/cosmwasm/issues/697
@@ -176,6 +179,7 @@ and this project adheres to
176179
[#802]: https://github.com/CosmWasm/cosmwasm/pull/802
177180
[#871]: https://github.com/CosmWasm/cosmwasm/issues/871
178181
[#861]: https://github.com/CosmWasm/cosmwasm/issues/861
182+
[#848]: https://github.com/CosmWasm/cosmwasm/issues/848
179183

180184
### Deprecated
181185

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

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,18 @@
213213
},
214214
"additionalProperties": false
215215
},
216+
{
217+
"type": "object",
218+
"required": [
219+
"distribution"
220+
],
221+
"properties": {
222+
"distribution": {
223+
"$ref": "#/definitions/DistributionMsg"
224+
}
225+
},
226+
"additionalProperties": false
227+
},
216228
{
217229
"description": "A Stargate message encoded the same way as a protobof [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). 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)",
218230
"type": "object",
@@ -264,6 +276,55 @@
264276
}
265277
]
266278
},
279+
"DistributionMsg": {
280+
"description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto",
281+
"anyOf": [
282+
{
283+
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.",
284+
"type": "object",
285+
"required": [
286+
"set_withdraw_address"
287+
],
288+
"properties": {
289+
"set_withdraw_address": {
290+
"type": "object",
291+
"required": [
292+
"address"
293+
],
294+
"properties": {
295+
"address": {
296+
"description": "The `withdraw_address`",
297+
"type": "string"
298+
}
299+
}
300+
}
301+
},
302+
"additionalProperties": false
303+
},
304+
{
305+
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
306+
"type": "object",
307+
"required": [
308+
"withdraw_delegator_reward"
309+
],
310+
"properties": {
311+
"withdraw_delegator_reward": {
312+
"type": "object",
313+
"required": [
314+
"validator"
315+
],
316+
"properties": {
317+
"validator": {
318+
"description": "The `validator_address`",
319+
"type": "string"
320+
}
321+
}
322+
}
323+
},
324+
"additionalProperties": false
325+
}
326+
]
327+
},
267328
"Empty": {
268329
"description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)",
269330
"type": "object"
@@ -470,34 +531,6 @@
470531
},
471532
"additionalProperties": false
472533
},
473-
{
474-
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37) followed by a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
475-
"type": "object",
476-
"required": [
477-
"withdraw"
478-
],
479-
"properties": {
480-
"withdraw": {
481-
"type": "object",
482-
"required": [
483-
"validator"
484-
],
485-
"properties": {
486-
"recipient": {
487-
"description": "this is the \"withdraw address\", the one that should receive the rewards if None, then use delegator address",
488-
"type": [
489-
"string",
490-
"null"
491-
]
492-
},
493-
"validator": {
494-
"type": "string"
495-
}
496-
}
497-
}
498-
},
499-
"additionalProperties": false
500-
},
501534
{
502535
"description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.",
503536
"type": "object",

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

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,18 @@
166166
},
167167
"additionalProperties": false
168168
},
169+
{
170+
"type": "object",
171+
"required": [
172+
"distribution"
173+
],
174+
"properties": {
175+
"distribution": {
176+
"$ref": "#/definitions/DistributionMsg"
177+
}
178+
},
179+
"additionalProperties": false
180+
},
169181
{
170182
"description": "A Stargate message encoded the same way as a protobof [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). 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)",
171183
"type": "object",
@@ -217,6 +229,55 @@
217229
}
218230
]
219231
},
232+
"DistributionMsg": {
233+
"description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto",
234+
"anyOf": [
235+
{
236+
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.",
237+
"type": "object",
238+
"required": [
239+
"set_withdraw_address"
240+
],
241+
"properties": {
242+
"set_withdraw_address": {
243+
"type": "object",
244+
"required": [
245+
"address"
246+
],
247+
"properties": {
248+
"address": {
249+
"description": "The `withdraw_address`",
250+
"type": "string"
251+
}
252+
}
253+
}
254+
},
255+
"additionalProperties": false
256+
},
257+
{
258+
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
259+
"type": "object",
260+
"required": [
261+
"withdraw_delegator_reward"
262+
],
263+
"properties": {
264+
"withdraw_delegator_reward": {
265+
"type": "object",
266+
"required": [
267+
"validator"
268+
],
269+
"properties": {
270+
"validator": {
271+
"description": "The `validator_address`",
272+
"type": "string"
273+
}
274+
}
275+
}
276+
},
277+
"additionalProperties": false
278+
}
279+
]
280+
},
220281
"Empty": {
221282
"description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)",
222283
"type": "object"
@@ -423,34 +484,6 @@
423484
},
424485
"additionalProperties": false
425486
},
426-
{
427-
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37) followed by a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
428-
"type": "object",
429-
"required": [
430-
"withdraw"
431-
],
432-
"properties": {
433-
"withdraw": {
434-
"type": "object",
435-
"required": [
436-
"validator"
437-
],
438-
"properties": {
439-
"recipient": {
440-
"description": "this is the \"withdraw address\", the one that should receive the rewards if None, then use delegator address",
441-
"type": [
442-
"string",
443-
"null"
444-
]
445-
},
446-
"validator": {
447-
"type": "string"
448-
}
449-
}
450-
}
451-
},
452-
"additionalProperties": false
453-
},
454487
{
455488
"description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.",
456489
"type": "object",

contracts/ibc-reflect/schema/packet_msg.json

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@
165165
},
166166
"additionalProperties": false
167167
},
168+
{
169+
"type": "object",
170+
"required": [
171+
"distribution"
172+
],
173+
"properties": {
174+
"distribution": {
175+
"$ref": "#/definitions/DistributionMsg"
176+
}
177+
},
178+
"additionalProperties": false
179+
},
168180
{
169181
"description": "A Stargate message encoded the same way as a protobof [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). 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)",
170182
"type": "object",
@@ -216,6 +228,55 @@
216228
}
217229
]
218230
},
231+
"DistributionMsg": {
232+
"description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto",
233+
"anyOf": [
234+
{
235+
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.",
236+
"type": "object",
237+
"required": [
238+
"set_withdraw_address"
239+
],
240+
"properties": {
241+
"set_withdraw_address": {
242+
"type": "object",
243+
"required": [
244+
"address"
245+
],
246+
"properties": {
247+
"address": {
248+
"description": "The `withdraw_address`",
249+
"type": "string"
250+
}
251+
}
252+
}
253+
},
254+
"additionalProperties": false
255+
},
256+
{
257+
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
258+
"type": "object",
259+
"required": [
260+
"withdraw_delegator_reward"
261+
],
262+
"properties": {
263+
"withdraw_delegator_reward": {
264+
"type": "object",
265+
"required": [
266+
"validator"
267+
],
268+
"properties": {
269+
"validator": {
270+
"description": "The `validator_address`",
271+
"type": "string"
272+
}
273+
}
274+
}
275+
},
276+
"additionalProperties": false
277+
}
278+
]
279+
},
219280
"Empty": {
220281
"description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)",
221282
"type": "object"
@@ -422,34 +483,6 @@
422483
},
423484
"additionalProperties": false
424485
},
425-
{
426-
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37) followed by a [MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
427-
"type": "object",
428-
"required": [
429-
"withdraw"
430-
],
431-
"properties": {
432-
"withdraw": {
433-
"type": "object",
434-
"required": [
435-
"validator"
436-
],
437-
"properties": {
438-
"recipient": {
439-
"description": "this is the \"withdraw address\", the one that should receive the rewards if None, then use delegator address",
440-
"type": [
441-
"string",
442-
"null"
443-
]
444-
},
445-
"validator": {
446-
"type": "string"
447-
}
448-
}
449-
}
450-
},
451-
"additionalProperties": false
452-
},
453486
{
454487
"description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.",
455488
"type": "object",

0 commit comments

Comments
 (0)