Skip to content

Commit 7a813db

Browse files
committed
feat: Add eureka capabilities (#2342)
1 parent 4c4af13 commit 7a813db

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

docs/CAPABILITIES-BUILT-IN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ might define others.
1111
"Stargate". It primarily includes protobuf messages and IBC support.
1212
- `staking` is for chains with the Cosmos SDK staking module. There are Cosmos
1313
chains that don't use this (e.g. Tgrade).
14+
- `eureka` is for messages and queries that came with the Cosmos SDK upgrade
15+
"Eureka".
1416
- `cosmwasm_1_1` enables the `BankQuery::Supply` query. Only chains running
1517
CosmWasm `1.1.0` or higher support this.
1618
- `cosmwasm_1_2` enables the `GovMsg::VoteWeighted` and `WasmMsg::Instantiate2`

packages/std/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ staking = []
2929
# stargate enables stargate-dependent messages and queries, like raw protobuf messages
3030
# as well as ibc-related functionality
3131
stargate = []
32+
# eureka enables eureka-dependent messages and queries
33+
eureka = []
3234
# This feature makes `BankQuery::Supply` available for the contract to call, but requires
3335
# the host blockchain to run CosmWasm `1.1.0` or higher.
3436
cosmwasm_1_1 = []

packages/std/src/exports.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ extern "C" fn requires_staking() {}
4444
#[no_mangle]
4545
extern "C" fn requires_stargate() {}
4646

47+
#[cfg(feature = "eureka")]
48+
#[no_mangle]
49+
extern "C" fn requires_eureka() {}
50+
4751
#[cfg(feature = "cosmwasm_1_1")]
4852
#[no_mangle]
4953
extern "C" fn requires_cosmwasm_1_1() {}

packages/std/src/results/cosmos_msg.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use schemars::JsonSchema;
66
use serde::{Deserialize, Serialize};
77

88
use crate::coin::Coin;
9+
#[cfg(feature = "eureka")]
910
use crate::eureka::EurekaMsg;
1011
#[cfg(feature = "stargate")]
1112
use crate::ibc::IbcMsg;
@@ -85,6 +86,7 @@ pub enum CosmosMsg<T = Empty> {
8586
Wasm(WasmMsg),
8687
#[cfg(feature = "stargate")]
8788
Gov(GovMsg),
89+
#[cfg(feature = "eureka")]
8890
Eureka(EurekaMsg),
8991
}
9092

@@ -110,6 +112,7 @@ impl<T> CosmosMsg<T> {
110112
CosmosMsg::Wasm(msg) => CosmosMsg::Wasm(msg),
111113
#[cfg(feature = "stargate")]
112114
CosmosMsg::Gov(msg) => CosmosMsg::Gov(msg),
115+
#[cfg(feature = "eureka")]
113116
CosmosMsg::Eureka(msg) => CosmosMsg::Eureka(msg),
114117
})
115118
}
@@ -488,6 +491,7 @@ impl<T> From<GovMsg> for CosmosMsg<T> {
488491
}
489492
}
490493

494+
#[cfg(feature = "eureka")]
491495
impl<T> From<EurekaMsg> for CosmosMsg<T> {
492496
fn from(msg: EurekaMsg) -> Self {
493497
CosmosMsg::Eureka(msg)

0 commit comments

Comments
 (0)