diff --git a/Cargo.toml b/Cargo.toml index 8bd99dd65..8f539a7c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ tokio = { version = "1.39", features = ["full"] } cw-orch = { path = "./cw-orch", version = "0.26.0" } cw-orch-daemon = { path = "./cw-orch-daemon", version = "0.27.0" } cw-orch-core = { path = "packages/cw-orch-core", version = "2.1.3" } -cw-orch-traits = { path = "packages/cw-orch-traits", version = "0.24.0" } +cw-orch-traits = { path = "packages/cw-orch-traits", version = "0.25.0" } cw-orch-mock = { path = "packages/cw-orch-mock", version = "0.24.2" } cw-orch-networks = { path = "packages/cw-orch-networks", version = "0.24.3" } diff --git a/cw-orch-daemon/src/sync/core.rs b/cw-orch-daemon/src/sync/core.rs index 63323a842..7320cc17b 100644 --- a/cw-orch-daemon/src/sync/core.rs +++ b/cw-orch-daemon/src/sync/core.rs @@ -239,7 +239,7 @@ impl TxHandler for DaemonBase { } impl Stargate for DaemonBase { - fn commit_any( + fn commit_any( &self, msgs: Vec, memo: Option<&str>, diff --git a/cw-orch-interchain/examples/timeout_packet.rs b/cw-orch-interchain/examples/timeout_packet.rs index ac07a0bd2..e5dc90d5a 100644 --- a/cw-orch-interchain/examples/timeout_packet.rs +++ b/cw-orch-interchain/examples/timeout_packet.rs @@ -3,10 +3,7 @@ use cw_orch::{environment::QueryHandler, prelude::*}; use cw_orch_interchain::prelude::*; use cw_orch_interchain_core::IbcPacketOutcome; use cw_orch_starship::Starship; -use ibc_proto::ibc::{ - applications::transfer::v1::{MsgTransfer, MsgTransferResponse}, - core::client::v1::Height, -}; +use ibc_proto::ibc::{applications::transfer::v1::MsgTransfer, core::client::v1::Height}; use ibc_relayer_types::core::ics24_host::identifier::PortId; use prost_types::Any; fn main() -> cw_orch::anyhow::Result<()> { @@ -33,7 +30,7 @@ fn main() -> cw_orch::anyhow::Result<()> { .interchain_channel .get_ordered_ports_from("juno-1")?; - let tx_resp = juno.commit_any::( + let tx_resp = juno.commit_any( vec![Any { value: MsgTransfer { source_port: channel.0.port.to_string(), diff --git a/packages/cw-orch-osmosis-test-tube/examples/complex.rs b/packages/cw-orch-osmosis-test-tube/examples/complex.rs index 0e7cbeb7a..18803aa97 100644 --- a/packages/cw-orch-osmosis-test-tube/examples/complex.rs +++ b/packages/cw-orch-osmosis-test-tube/examples/complex.rs @@ -8,9 +8,7 @@ use cw_orch::prelude::*; use cw_orch_osmosis_test_tube::OsmosisTestTube; use osmosis_test_tube::osmosis_std::types::{ cosmos::base::v1beta1::Coin, - osmosis::tokenfactory::v1beta1::{ - MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, - }, + osmosis::tokenfactory::v1beta1::{MsgCreateDenom, MsgMint}, }; use osmosis_test_tube::Account; use prost::Message; @@ -34,7 +32,7 @@ pub fn main() -> cw_orch::anyhow::Result<()> { contract_counter.get_count()?; // We create a new denom - chain.commit_any::( + chain.commit_any( vec![Any { type_url: MsgCreateDenom::TYPE_URL.to_string(), value: MsgCreateDenom { @@ -47,7 +45,7 @@ pub fn main() -> cw_orch::anyhow::Result<()> { )?; let denom = format!("factory/{}/{}", sender_addr, SUBDENOM); // We mint some tokens - chain.commit_any::( + chain.commit_any( vec![Any { type_url: MsgMint::TYPE_URL.to_string(), value: MsgMint { diff --git a/packages/cw-orch-osmosis-test-tube/src/core.rs b/packages/cw-orch-osmosis-test-tube/src/core.rs index 9a0268a6e..56e4230bb 100644 --- a/packages/cw-orch-osmosis-test-tube/src/core.rs +++ b/packages/cw-orch-osmosis-test-tube/src/core.rs @@ -10,9 +10,7 @@ use cosmwasm_std::{Binary, Coin, Uint128}; use cw_orch_core::CwEnvError; use cw_orch_mock::cw_multi_test::AppResponse; use cw_orch_traits::Stargate; -use osmosis_test_tube::{ - Account, Bank, ExecuteResponse, Gamm, Module, Runner, RunnerError, SigningAccount, Wasm, -}; +use osmosis_test_tube::{Account, Bank, Gamm, Module, Runner, RunnerError, SigningAccount, Wasm}; // This should be the way to import stuff. // But apparently osmosis-test-tube doesn't have the same dependencies as the test-tube package @@ -381,27 +379,34 @@ impl BankSetter for OsmosisTestTube { } impl Stargate for OsmosisTestTube { - fn commit_any( + fn commit_any( &self, msgs: Vec, _memo: Option<&str>, ) -> Result { - let msgs = msgs - .into_iter() - .map(|any| osmosis_test_tube::cosmrs::Any { - type_url: any.type_url, - value: any.value, - }) - .collect(); - let tx_response: ExecuteResponse = self + let msgs = msgs.into_iter().map(|any| osmosis_test_tube::cosmrs::Any { + type_url: any.type_url, + value: any.value, + }); + let tx_response = self .app .borrow() - .execute_multiple_raw(msgs, &self.sender) + .execute_with_selected_authenticators(msgs, &self.sender, &self.sender, &[]) .map_err(map_err)?; Ok(AppResponse { - data: Some(Binary::new(tx_response.raw_data)), - events: tx_response.events, + data: None, + events: tx_response + .events + .into_iter() + .map(|e| { + let mut event = cosmwasm_std::Event::new(e.r#type); + for attribute in e.attributes { + event = event.add_attribute(attribute.key, attribute.value) + } + event + }) + .collect(), }) } } diff --git a/packages/cw-orch-traits/Cargo.toml b/packages/cw-orch-traits/Cargo.toml index 04f176bcd..e20549e22 100644 --- a/packages/cw-orch-traits/Cargo.toml +++ b/packages/cw-orch-traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cw-orch-traits" -version = "0.24.1" +version = "0.25.0" authors = { workspace = true } edition = { workspace = true } license = { workspace = true } @@ -13,6 +13,4 @@ readme = "README.md" [dependencies] cw-orch-core = { workspace = true } -# Prost and Prost-types were kept at 0.11.9 here, because osmosis-test-tube doesn't support prost above 0.11.9 prost-types = { workspace = true } -prost = { workspace = true } diff --git a/packages/cw-orch-traits/src/stargate.rs b/packages/cw-orch-traits/src/stargate.rs index 9ef1ff6e4..2d0c8bfe8 100644 --- a/packages/cw-orch-traits/src/stargate.rs +++ b/packages/cw-orch-traits/src/stargate.rs @@ -1,14 +1,11 @@ use cw_orch_core::environment::TxHandler; -use prost::Message; use prost_types::Any; /// Alows the execution of stargate like messages on cw-orch environments pub trait Stargate: TxHandler { /// Execute a custom abci/starship message on the environment /// The message should already be encoded as protobuf any - /// We enforce a generic parameter to be able to unwrap the response (because of osmosis test tube for now) - /// This is however always a good practice to know which is the response to the tx type that you send - fn commit_any( + fn commit_any( &self, msgs: Vec, memo: Option<&str>, diff --git a/packages/interchain/proto/src/tokenfactory.rs b/packages/interchain/proto/src/tokenfactory.rs index cddd066e1..eeaefd93f 100644 --- a/packages/interchain/proto/src/tokenfactory.rs +++ b/packages/interchain/proto/src/tokenfactory.rs @@ -3,12 +3,8 @@ use cw_orch_interchain_core::{ channel::InterchainChannel, IbcQueryHandler, InterchainEnv, InterchainError, NestedPacketsFlow, }; -use ibc_proto::ibc::{ - applications::transfer::v1::MsgTransferResponse, apps::transfer::v1::MsgTransfer, -}; -use osmosis_std::types::osmosis::tokenfactory::v1beta1::{ - MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, -}; +use ibc_proto::ibc::apps::transfer::v1::MsgTransfer; +use osmosis_std::types::osmosis::tokenfactory::v1beta1::{MsgCreateDenom, MsgMint}; use prost::{Message, Name}; use tonic::transport::Channel; @@ -32,7 +28,7 @@ pub fn create_denom( } .to_any(); - chain.commit_any::(vec![any.into()], None)?; + chain.commit_any(vec![any.into()], None)?; log::info!("Created denom {}", get_denom(chain, token_name)); @@ -71,7 +67,7 @@ pub fn mint( } .to_any(); - chain.commit_any::(vec![any.into()], None)?; + chain.commit_any(vec![any.into()], None)?; log::info!("Minted coins {} {}", amount, get_denom(chain, token_name)); @@ -115,7 +111,7 @@ pub fn transfer_tokens( + .commit_any( vec![prost_types::Any { type_url: MsgTransfer::full_name(), value: msg_transfer.encode_to_vec(),