Skip to content

Commit

Permalink
Merge pull request #2345 from CosmWasm/eureka-capabilities
Browse files Browse the repository at this point in the history
feat: Add eureka capabilities (#2342)
  • Loading branch information
jawoznia authored Jan 22, 2025
2 parents 4c4af13 + a9825b8 commit a73affb
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 505 deletions.
84 changes: 0 additions & 84 deletions contracts/ibc-reflect-send/schema/ibc-reflect-send.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,6 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"eureka"
],
"properties": {
"eureka": {
"$ref": "#/definitions/EurekaMsg"
}
},
"additionalProperties": false
}
]
},
Expand Down Expand Up @@ -376,78 +364,6 @@
"type": "object",
"additionalProperties": false
},
"EurekaMsg": {
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
"oneOf": [
{
"description": "Sends an IBC packet with given payloads over the existing channel.",
"type": "object",
"required": [
"send_packet"
],
"properties": {
"send_packet": {
"type": "object",
"required": [
"channel_id",
"payloads",
"timeout"
],
"properties": {
"channel_id": {
"description": "existing channel to send the tokens over",
"type": "string"
},
"payloads": {
"type": "array",
"items": {
"$ref": "#/definitions/EurekaPayload"
}
},
"timeout": {
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"EurekaPayload": {
"description": "Payload value should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.",
"type": "object",
"required": [
"destination_port",
"encoding",
"value",
"version"
],
"properties": {
"destination_port": {
"description": "The port id on the chain where the packet is sent to (external chain).",
"type": "string"
},
"encoding": {
"description": "Encoding used to serialize the [EurekaPayload::value].",
"type": "string"
},
"value": {
"description": "Encoded payload data.",
"allOf": [
{
"$ref": "#/definitions/Binary"
}
]
},
"version": {
"description": "Version of the receiving contract.",
"type": "string"
}
},
"additionalProperties": false
},
"GovMsg": {
"description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: /~https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
"oneOf": [
Expand Down
84 changes: 0 additions & 84 deletions contracts/ibc-reflect-send/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,6 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"eureka"
],
"properties": {
"eureka": {
"$ref": "#/definitions/EurekaMsg"
}
},
"additionalProperties": false
}
]
},
Expand Down Expand Up @@ -317,78 +305,6 @@
"type": "object",
"additionalProperties": false
},
"EurekaMsg": {
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
"oneOf": [
{
"description": "Sends an IBC packet with given payloads over the existing channel.",
"type": "object",
"required": [
"send_packet"
],
"properties": {
"send_packet": {
"type": "object",
"required": [
"channel_id",
"payloads",
"timeout"
],
"properties": {
"channel_id": {
"description": "existing channel to send the tokens over",
"type": "string"
},
"payloads": {
"type": "array",
"items": {
"$ref": "#/definitions/EurekaPayload"
}
},
"timeout": {
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"EurekaPayload": {
"description": "Payload value should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.",
"type": "object",
"required": [
"destination_port",
"encoding",
"value",
"version"
],
"properties": {
"destination_port": {
"description": "The port id on the chain where the packet is sent to (external chain).",
"type": "string"
},
"encoding": {
"description": "Encoding used to serialize the [EurekaPayload::value].",
"type": "string"
},
"value": {
"description": "Encoded payload data.",
"allOf": [
{
"$ref": "#/definitions/Binary"
}
]
},
"version": {
"description": "Version of the receiving contract.",
"type": "string"
}
},
"additionalProperties": false
},
"GovMsg": {
"description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: /~https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
"oneOf": [
Expand Down
84 changes: 0 additions & 84 deletions contracts/ibc-reflect-send/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,6 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"eureka"
],
"properties": {
"eureka": {
"$ref": "#/definitions/EurekaMsg"
}
},
"additionalProperties": false
}
]
},
Expand Down Expand Up @@ -365,78 +353,6 @@
"type": "object",
"additionalProperties": false
},
"EurekaMsg": {
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
"oneOf": [
{
"description": "Sends an IBC packet with given payloads over the existing channel.",
"type": "object",
"required": [
"send_packet"
],
"properties": {
"send_packet": {
"type": "object",
"required": [
"channel_id",
"payloads",
"timeout"
],
"properties": {
"channel_id": {
"description": "existing channel to send the tokens over",
"type": "string"
},
"payloads": {
"type": "array",
"items": {
"$ref": "#/definitions/EurekaPayload"
}
},
"timeout": {
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"EurekaPayload": {
"description": "Payload value should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.",
"type": "object",
"required": [
"destination_port",
"encoding",
"value",
"version"
],
"properties": {
"destination_port": {
"description": "The port id on the chain where the packet is sent to (external chain).",
"type": "string"
},
"encoding": {
"description": "Encoding used to serialize the [EurekaPayload::value].",
"type": "string"
},
"value": {
"description": "Encoded payload data.",
"allOf": [
{
"$ref": "#/definitions/Binary"
}
]
},
"version": {
"description": "Version of the receiving contract.",
"type": "string"
}
},
"additionalProperties": false
},
"GovMsg": {
"description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: /~https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
"oneOf": [
Expand Down
84 changes: 0 additions & 84 deletions contracts/ibc-reflect/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,6 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"eureka"
],
"properties": {
"eureka": {
"$ref": "#/definitions/EurekaMsg"
}
},
"additionalProperties": false
}
]
},
Expand All @@ -346,78 +334,6 @@
"type": "object",
"additionalProperties": false
},
"EurekaMsg": {
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
"oneOf": [
{
"description": "Sends an IBC packet with given payloads over the existing channel.",
"type": "object",
"required": [
"send_packet"
],
"properties": {
"send_packet": {
"type": "object",
"required": [
"channel_id",
"payloads",
"timeout"
],
"properties": {
"channel_id": {
"description": "existing channel to send the tokens over",
"type": "string"
},
"payloads": {
"type": "array",
"items": {
"$ref": "#/definitions/EurekaPayload"
}
},
"timeout": {
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"EurekaPayload": {
"description": "Payload value should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.",
"type": "object",
"required": [
"destination_port",
"encoding",
"value",
"version"
],
"properties": {
"destination_port": {
"description": "The port id on the chain where the packet is sent to (external chain).",
"type": "string"
},
"encoding": {
"description": "Encoding used to serialize the [EurekaPayload::value].",
"type": "string"
},
"value": {
"description": "Encoded payload data.",
"allOf": [
{
"$ref": "#/definitions/Binary"
}
]
},
"version": {
"description": "Version of the receiving contract.",
"type": "string"
}
},
"additionalProperties": false
},
"GovMsg": {
"description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: /~https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
"oneOf": [
Expand Down
Loading

0 comments on commit a73affb

Please sign in to comment.