-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1833 from CosmWasm/refactor-acknowledgement-msg
Refactor AcknowledgementMsg in ibc-reflect and ibc-reflect-send
- Loading branch information
Showing
16 changed files
with
310 additions
and
94 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_balances.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "AcknowledgementMsgBalances", | ||
"description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"ok" | ||
], | ||
"properties": { | ||
"ok": { | ||
"$ref": "#/definitions/BalancesResponse" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"error" | ||
], | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
], | ||
"definitions": { | ||
"BalancesResponse": { | ||
"description": "This is the success response we send on ack for PacketMsg::Balance. Just acknowledge success or error", | ||
"type": "object", | ||
"required": [ | ||
"account", | ||
"balances" | ||
], | ||
"properties": { | ||
"account": { | ||
"type": "string" | ||
}, | ||
"balances": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Coin" | ||
} | ||
} | ||
} | ||
}, | ||
"Coin": { | ||
"type": "object", | ||
"required": [ | ||
"amount", | ||
"denom" | ||
], | ||
"properties": { | ||
"amount": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"denom": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"Uint128": { | ||
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", | ||
"type": "string" | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_dispatch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "AcknowledgementMsgDispatch", | ||
"description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"ok" | ||
], | ||
"properties": { | ||
"ok": { | ||
"type": "null" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"error" | ||
], | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
45 changes: 45 additions & 0 deletions
45
contracts/ibc-reflect-send/schema/ibc/acknowledgement_msg_who_am_i.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "AcknowledgementMsgWhoAmI", | ||
"description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"ok" | ||
], | ||
"properties": { | ||
"ok": { | ||
"$ref": "#/definitions/WhoAmIResponse" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"error" | ||
], | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
], | ||
"definitions": { | ||
"WhoAmIResponse": { | ||
"description": "This is the success response we send on ack for PacketMsg::WhoAmI. Return the caller's account address on the remote chain", | ||
"type": "object", | ||
"required": [ | ||
"account" | ||
], | ||
"properties": { | ||
"account": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
contracts/ibc-reflect/schema/acknowledgement_msg_dispatch.json
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
contracts/ibc-reflect/schema/acknowledgement_msg_who_am_i.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
contracts/ibc-reflect/schema/ibc/acknowledgement_msg_dispatch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "AcknowledgementMsgDispatch", | ||
"description": "A custom acknowledgement type. The success type `T` depends on the PacketMsg variant.\n\nThis could be refactored to use [StdAck] at some point. However, it has a different success variant name (\"ok\" vs. \"result\") and a JSON payload instead of a binary payload.\n\n[StdAck]: https://github.com/CosmWasm/cosmwasm/issues/1512", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"ok" | ||
], | ||
"properties": { | ||
"ok": { | ||
"type": "null" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"error" | ||
], | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
Oops, something went wrong.