Skip to content

Commit

Permalink
feat: Update CosmosMsg with Eureka variant
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Jan 20, 2025
1 parent 84ba46a commit 3946f2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to

- cosmwasm-schema: The schema export now doesn't overwrite existing
`additionalProperties` values anymore ([#2310])
- cosmwasm-std: Added new `EurekaMsg` and `CosmosMsg::Eureka` variant ([#2340])

[#2310]: https://github.com/CosmWasm/cosmwasm/pull/2310

Expand Down
9 changes: 9 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;
use crate::eureka::EurekaMsg;
#[cfg(feature = "stargate")]
use crate::ibc::IbcMsg;
use crate::prelude::*;
Expand Down Expand Up @@ -84,6 +85,7 @@ pub enum CosmosMsg<T = Empty> {
Wasm(WasmMsg),
#[cfg(feature = "stargate")]
Gov(GovMsg),
Eureka(EurekaMsg),
}

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

impl<T> From<EurekaMsg> for CosmosMsg<T> {
fn from(msg: EurekaMsg) -> Self {
CosmosMsg::Eureka(msg)
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 3946f2b

Please sign in to comment.