Skip to content

Commit a73affb

Browse files
authored
Merge pull request #2345 from CosmWasm/eureka-capabilities
feat: Add eureka capabilities (#2342)
2 parents 4c4af13 + a9825b8 commit a73affb

File tree

10 files changed

+13
-505
lines changed

10 files changed

+13
-505
lines changed

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

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,6 @@
305305
}
306306
},
307307
"additionalProperties": false
308-
},
309-
{
310-
"type": "object",
311-
"required": [
312-
"eureka"
313-
],
314-
"properties": {
315-
"eureka": {
316-
"$ref": "#/definitions/EurekaMsg"
317-
}
318-
},
319-
"additionalProperties": false
320308
}
321309
]
322310
},
@@ -376,78 +364,6 @@
376364
"type": "object",
377365
"additionalProperties": false
378366
},
379-
"EurekaMsg": {
380-
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
381-
"oneOf": [
382-
{
383-
"description": "Sends an IBC packet with given payloads over the existing channel.",
384-
"type": "object",
385-
"required": [
386-
"send_packet"
387-
],
388-
"properties": {
389-
"send_packet": {
390-
"type": "object",
391-
"required": [
392-
"channel_id",
393-
"payloads",
394-
"timeout"
395-
],
396-
"properties": {
397-
"channel_id": {
398-
"description": "existing channel to send the tokens over",
399-
"type": "string"
400-
},
401-
"payloads": {
402-
"type": "array",
403-
"items": {
404-
"$ref": "#/definitions/EurekaPayload"
405-
}
406-
},
407-
"timeout": {
408-
"$ref": "#/definitions/Timestamp"
409-
}
410-
},
411-
"additionalProperties": false
412-
}
413-
},
414-
"additionalProperties": false
415-
}
416-
]
417-
},
418-
"EurekaPayload": {
419-
"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.",
420-
"type": "object",
421-
"required": [
422-
"destination_port",
423-
"encoding",
424-
"value",
425-
"version"
426-
],
427-
"properties": {
428-
"destination_port": {
429-
"description": "The port id on the chain where the packet is sent to (external chain).",
430-
"type": "string"
431-
},
432-
"encoding": {
433-
"description": "Encoding used to serialize the [EurekaPayload::value].",
434-
"type": "string"
435-
},
436-
"value": {
437-
"description": "Encoded payload data.",
438-
"allOf": [
439-
{
440-
"$ref": "#/definitions/Binary"
441-
}
442-
]
443-
},
444-
"version": {
445-
"description": "Version of the receiving contract.",
446-
"type": "string"
447-
}
448-
},
449-
"additionalProperties": false
450-
},
451367
"GovMsg": {
452368
"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), }, ], })) } ```",
453369
"oneOf": [

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

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,6 @@
246246
}
247247
},
248248
"additionalProperties": false
249-
},
250-
{
251-
"type": "object",
252-
"required": [
253-
"eureka"
254-
],
255-
"properties": {
256-
"eureka": {
257-
"$ref": "#/definitions/EurekaMsg"
258-
}
259-
},
260-
"additionalProperties": false
261249
}
262250
]
263251
},
@@ -317,78 +305,6 @@
317305
"type": "object",
318306
"additionalProperties": false
319307
},
320-
"EurekaMsg": {
321-
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
322-
"oneOf": [
323-
{
324-
"description": "Sends an IBC packet with given payloads over the existing channel.",
325-
"type": "object",
326-
"required": [
327-
"send_packet"
328-
],
329-
"properties": {
330-
"send_packet": {
331-
"type": "object",
332-
"required": [
333-
"channel_id",
334-
"payloads",
335-
"timeout"
336-
],
337-
"properties": {
338-
"channel_id": {
339-
"description": "existing channel to send the tokens over",
340-
"type": "string"
341-
},
342-
"payloads": {
343-
"type": "array",
344-
"items": {
345-
"$ref": "#/definitions/EurekaPayload"
346-
}
347-
},
348-
"timeout": {
349-
"$ref": "#/definitions/Timestamp"
350-
}
351-
},
352-
"additionalProperties": false
353-
}
354-
},
355-
"additionalProperties": false
356-
}
357-
]
358-
},
359-
"EurekaPayload": {
360-
"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.",
361-
"type": "object",
362-
"required": [
363-
"destination_port",
364-
"encoding",
365-
"value",
366-
"version"
367-
],
368-
"properties": {
369-
"destination_port": {
370-
"description": "The port id on the chain where the packet is sent to (external chain).",
371-
"type": "string"
372-
},
373-
"encoding": {
374-
"description": "Encoding used to serialize the [EurekaPayload::value].",
375-
"type": "string"
376-
},
377-
"value": {
378-
"description": "Encoded payload data.",
379-
"allOf": [
380-
{
381-
"$ref": "#/definitions/Binary"
382-
}
383-
]
384-
},
385-
"version": {
386-
"description": "Version of the receiving contract.",
387-
"type": "string"
388-
}
389-
},
390-
"additionalProperties": false
391-
},
392308
"GovMsg": {
393309
"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), }, ], })) } ```",
394310
"oneOf": [

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

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -294,18 +294,6 @@
294294
}
295295
},
296296
"additionalProperties": false
297-
},
298-
{
299-
"type": "object",
300-
"required": [
301-
"eureka"
302-
],
303-
"properties": {
304-
"eureka": {
305-
"$ref": "#/definitions/EurekaMsg"
306-
}
307-
},
308-
"additionalProperties": false
309297
}
310298
]
311299
},
@@ -365,78 +353,6 @@
365353
"type": "object",
366354
"additionalProperties": false
367355
},
368-
"EurekaMsg": {
369-
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
370-
"oneOf": [
371-
{
372-
"description": "Sends an IBC packet with given payloads over the existing channel.",
373-
"type": "object",
374-
"required": [
375-
"send_packet"
376-
],
377-
"properties": {
378-
"send_packet": {
379-
"type": "object",
380-
"required": [
381-
"channel_id",
382-
"payloads",
383-
"timeout"
384-
],
385-
"properties": {
386-
"channel_id": {
387-
"description": "existing channel to send the tokens over",
388-
"type": "string"
389-
},
390-
"payloads": {
391-
"type": "array",
392-
"items": {
393-
"$ref": "#/definitions/EurekaPayload"
394-
}
395-
},
396-
"timeout": {
397-
"$ref": "#/definitions/Timestamp"
398-
}
399-
},
400-
"additionalProperties": false
401-
}
402-
},
403-
"additionalProperties": false
404-
}
405-
]
406-
},
407-
"EurekaPayload": {
408-
"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.",
409-
"type": "object",
410-
"required": [
411-
"destination_port",
412-
"encoding",
413-
"value",
414-
"version"
415-
],
416-
"properties": {
417-
"destination_port": {
418-
"description": "The port id on the chain where the packet is sent to (external chain).",
419-
"type": "string"
420-
},
421-
"encoding": {
422-
"description": "Encoding used to serialize the [EurekaPayload::value].",
423-
"type": "string"
424-
},
425-
"value": {
426-
"description": "Encoded payload data.",
427-
"allOf": [
428-
{
429-
"$ref": "#/definitions/Binary"
430-
}
431-
]
432-
},
433-
"version": {
434-
"description": "Version of the receiving contract.",
435-
"type": "string"
436-
}
437-
},
438-
"additionalProperties": false
439-
},
440356
"GovMsg": {
441357
"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), }, ], })) } ```",
442358
"oneOf": [

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

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,6 @@
322322
}
323323
},
324324
"additionalProperties": false
325-
},
326-
{
327-
"type": "object",
328-
"required": [
329-
"eureka"
330-
],
331-
"properties": {
332-
"eureka": {
333-
"$ref": "#/definitions/EurekaMsg"
334-
}
335-
},
336-
"additionalProperties": false
337325
}
338326
]
339327
},
@@ -346,78 +334,6 @@
346334
"type": "object",
347335
"additionalProperties": false
348336
},
349-
"EurekaMsg": {
350-
"description": "These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts",
351-
"oneOf": [
352-
{
353-
"description": "Sends an IBC packet with given payloads over the existing channel.",
354-
"type": "object",
355-
"required": [
356-
"send_packet"
357-
],
358-
"properties": {
359-
"send_packet": {
360-
"type": "object",
361-
"required": [
362-
"channel_id",
363-
"payloads",
364-
"timeout"
365-
],
366-
"properties": {
367-
"channel_id": {
368-
"description": "existing channel to send the tokens over",
369-
"type": "string"
370-
},
371-
"payloads": {
372-
"type": "array",
373-
"items": {
374-
"$ref": "#/definitions/EurekaPayload"
375-
}
376-
},
377-
"timeout": {
378-
"$ref": "#/definitions/Timestamp"
379-
}
380-
},
381-
"additionalProperties": false
382-
}
383-
},
384-
"additionalProperties": false
385-
}
386-
]
387-
},
388-
"EurekaPayload": {
389-
"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.",
390-
"type": "object",
391-
"required": [
392-
"destination_port",
393-
"encoding",
394-
"value",
395-
"version"
396-
],
397-
"properties": {
398-
"destination_port": {
399-
"description": "The port id on the chain where the packet is sent to (external chain).",
400-
"type": "string"
401-
},
402-
"encoding": {
403-
"description": "Encoding used to serialize the [EurekaPayload::value].",
404-
"type": "string"
405-
},
406-
"value": {
407-
"description": "Encoded payload data.",
408-
"allOf": [
409-
{
410-
"$ref": "#/definitions/Binary"
411-
}
412-
]
413-
},
414-
"version": {
415-
"description": "Version of the receiving contract.",
416-
"type": "string"
417-
}
418-
},
419-
"additionalProperties": false
420-
},
421337
"GovMsg": {
422338
"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), }, ], })) } ```",
423339
"oneOf": [

0 commit comments

Comments
 (0)