Skip to content

Commit

Permalink
feat: Add eureka capabilities (#2342)
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Jan 21, 2025
1 parent 4c4af13 commit 7a813db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/CAPABILITIES-BUILT-IN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ might define others.
"Stargate". It primarily includes protobuf messages and IBC support.
- `staking` is for chains with the Cosmos SDK staking module. There are Cosmos
chains that don't use this (e.g. Tgrade).
- `eureka` is for messages and queries that came with the Cosmos SDK upgrade
"Eureka".
- `cosmwasm_1_1` enables the `BankQuery::Supply` query. Only chains running
CosmWasm `1.1.0` or higher support this.
- `cosmwasm_1_2` enables the `GovMsg::VoteWeighted` and `WasmMsg::Instantiate2`
Expand Down
2 changes: 2 additions & 0 deletions packages/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ staking = []
# stargate enables stargate-dependent messages and queries, like raw protobuf messages
# as well as ibc-related functionality
stargate = []
# eureka enables eureka-dependent messages and queries
eureka = []
# This feature makes `BankQuery::Supply` available for the contract to call, but requires
# the host blockchain to run CosmWasm `1.1.0` or higher.
cosmwasm_1_1 = []
Expand Down
4 changes: 4 additions & 0 deletions packages/std/src/exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ extern "C" fn requires_staking() {}
#[no_mangle]
extern "C" fn requires_stargate() {}

#[cfg(feature = "eureka")]
#[no_mangle]
extern "C" fn requires_eureka() {}

#[cfg(feature = "cosmwasm_1_1")]
#[no_mangle]
extern "C" fn requires_cosmwasm_1_1() {}
Expand Down
4 changes: 4 additions & 0 deletions packages/std/src/results/cosmos_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::coin::Coin;
#[cfg(feature = "eureka")]
use crate::eureka::EurekaMsg;
#[cfg(feature = "stargate")]
use crate::ibc::IbcMsg;
Expand Down Expand Up @@ -85,6 +86,7 @@ pub enum CosmosMsg<T = Empty> {
Wasm(WasmMsg),
#[cfg(feature = "stargate")]
Gov(GovMsg),
#[cfg(feature = "eureka")]
Eureka(EurekaMsg),
}

Expand All @@ -110,6 +112,7 @@ impl<T> CosmosMsg<T> {
CosmosMsg::Wasm(msg) => CosmosMsg::Wasm(msg),
#[cfg(feature = "stargate")]
CosmosMsg::Gov(msg) => CosmosMsg::Gov(msg),
#[cfg(feature = "eureka")]
CosmosMsg::Eureka(msg) => CosmosMsg::Eureka(msg),
})
}
Expand Down Expand Up @@ -488,6 +491,7 @@ impl<T> From<GovMsg> for CosmosMsg<T> {
}
}

#[cfg(feature = "eureka")]
impl<T> From<EurekaMsg> for CosmosMsg<T> {
fn from(msg: EurekaMsg) -> Self {
CosmosMsg::Eureka(msg)
Expand Down

0 comments on commit 7a813db

Please sign in to comment.