From 315c09326d37cf2be2bf2e397ac512600994ef17 Mon Sep 17 00:00:00 2001 From: Mykhailo Donchenko <91957742+Buckram123@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:04:58 +0300 Subject: [PATCH] Prost, cosmrs, cosmos-sdk-proto bump (#472) * prost bump * add TODO's in toml * add comment about comp test * remove v50 patch * fix doctests * small todo update --- Cargo.toml | 22 +- .../src/cosmos_proto_patches/mod.rs | 5 - .../src/cosmos_proto_patches/v0_50/mod.rs | 1 - .../src/cosmos_proto_patches/v0_50/tx.rs | 224 ------------------ cw-orch-daemon/src/lib.rs | 1 - cw-orch-daemon/src/queriers/node.rs | 4 +- cw-orch-daemon/tests/authz.rs | 8 +- cw-orch-interchain/Cargo.toml | 2 + cw-orch-interchain/examples/timeout_packet.rs | 17 +- cw-orch/examples/complex_testnet_daemon.rs | 204 ++++++++-------- .../interchain/interchain-core/Cargo.toml | 2 + .../interchain/interchain-core/src/env.rs | 11 +- 12 files changed, 141 insertions(+), 360 deletions(-) delete mode 100644 cw-orch-daemon/src/cosmos_proto_patches/mod.rs delete mode 100644 cw-orch-daemon/src/cosmos_proto_patches/v0_50/mod.rs delete mode 100644 cw-orch-daemon/src/cosmos_proto_patches/v0_50/tx.rs diff --git a/Cargo.toml b/Cargo.toml index 2a17dfb79..09fc7cc64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,15 +6,20 @@ members = [ "packages/cw-orch-core", "packages/cw-orch-mock", "packages/cw-orch-networks", + # TODO: clone-cw-multi-test depends on cw-orch, so needs to be bumped first # "packages/clone-testing", + # TODO: release those after *-std reaches to prost 0.13 # "packages/cw-orch-osmosis-test-tube", - "packages/cw-orch-neutron-test-tube", + # "packages/cw-orch-neutron-test-tube", "packages/cw-orch-traits", "test_contracts/*", "packages/macros/*", "packages/interchain/*", ] -exclude = ["test_contracts/compatibility-test"] +exclude = [ + "test_contracts/compatibility-test", # TODO: add new after cw-orch-core 2.0.0 as it's breaking, it shouldn't be compatible + "packages/interchain/proto", # TODO: Release cw-orch-proto after osmosis-std reaches prost 0.13 +] resolver = "2" [workspace.package] @@ -27,7 +32,7 @@ repository = "https://github.com/AbstractSDK/cw-orchestrator" cw-utils = { version = "2.0.0" } cosmwasm-std = { version = "2.1" } cw-storage-plus = { version = "2.0.0" } -cosmos-sdk-proto = { version = "0.22.0", default-features = false } # https://github.com/cosmos/cosmos-rust/issues/497 +cosmos-sdk-proto = { version = "0.24.0", default-features = false } cw-multi-test = { package = "abstract-cw-multi-test", version = "2.0.2", features = [ "cosmwasm_1_2", @@ -62,7 +67,7 @@ cw-orch-interchain-core = { path = "packages/interchain/interchain-core", versio cw-orch-interchain-daemon = { path = "packages/interchain/interchain-daemon", version = "0.5.0" } cw-orch-interchain-mock = { path = "packages/interchain/interchain-mock", version = "0.5.0" } cw-orch-starship = { path = "packages/interchain/starship", version = "0.5.0" } -cw-orch-proto = { path = "packages/interchain/proto", version = "0.5.0" } +# cw-orch-proto = { path = "packages/interchain/proto", version = "0.5.0" } # prost, tonic, cosmrs bump locked by osmosis (we use it for tokenfactory) #Clone Testing # cw-orch-clone-testing = { version = "0.6.1", path = "packages/clone-testing" } @@ -70,10 +75,11 @@ cw-orch-proto = { path = "packages/interchain/proto", version = "0.5.0" } thiserror = { version = "1.0.63" } sha2 = { version = "0.10.8" } serde_json = "1.0.125" -tonic = { version = "0.11.0" } -prost-types = "0.12.3" -prost = "0.12.3" # prost, tonic, cosmrs bump locked by osmosis (we use it for tokenfactory -cosmrs = { version = "0.17.0" } +tonic = { version = "0.12.1" } +prost-types = "0.13.1" +prost = "0.13.1" +cosmrs = { version = "0.19.0" } +ibc-proto = { version = "0.47.0" } # Test deps speculoos = "0.11.0" diff --git a/cw-orch-daemon/src/cosmos_proto_patches/mod.rs b/cw-orch-daemon/src/cosmos_proto_patches/mod.rs deleted file mode 100644 index 47183995a..000000000 --- a/cw-orch-daemon/src/cosmos_proto_patches/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -/// Allows cw-orch to query tx by events because of the API change described in : -/// https://github.com/cosmos/cosmos-sdk/blob/b48fd66678a98b915888cc84976399ac17164370/CHANGELOG.md?plain=1#L595 -/// TODO : Remove when cosmos-rs is updated (current version supported v0.46) -/// https://github.com/cosmos/cosmos-rust/blob/main/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT -pub mod v0_50; diff --git a/cw-orch-daemon/src/cosmos_proto_patches/v0_50/mod.rs b/cw-orch-daemon/src/cosmos_proto_patches/v0_50/mod.rs deleted file mode 100644 index d7c32947c..000000000 --- a/cw-orch-daemon/src/cosmos_proto_patches/v0_50/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod tx; diff --git a/cw-orch-daemon/src/cosmos_proto_patches/v0_50/tx.rs b/cw-orch-daemon/src/cosmos_proto_patches/v0_50/tx.rs deleted file mode 100644 index 32660b5a2..000000000 --- a/cw-orch-daemon/src/cosmos_proto_patches/v0_50/tx.rs +++ /dev/null @@ -1,224 +0,0 @@ -// @generated -/// Generated client implementations. -pub mod service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use crate::cosmos_modules::tx::GetTxsEventResponse; - use crate::cosmos_proto_patches::v0_50::tx::GetTxsEventRequest; - use tonic::codegen::*; - #[derive(Debug, Clone)] - pub struct ServiceClient { - inner: tonic::client::Grpc, - } - impl ServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - pub async fn get_txs_event( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/GetTxsEvent"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "GetTxsEvent")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use crate::cosmos_modules::tx::GetTxsEventResponse; - use crate::cosmos_proto_patches::v0_50::tx::GetTxsEventRequest; - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServiceServer. - #[async_trait] - pub trait Service: Send + Sync + 'static { - async fn get_txs_event( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - #[derive(Debug)] - pub struct ServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl ServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - } - impl tonic::codegen::Service> for ServiceServer - where - T: Service, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/cosmos.tx.v1beta1.Service/GetTxsEvent" => { - #[allow(non_camel_case_types)] - struct GetTxsEventSvc(pub Arc); - impl tonic::server::UnaryService for GetTxsEventSvc { - type Response = GetTxsEventResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).get_txs_event(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetTxsEventSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), - } - } - } - impl Clone for ServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for ServiceServer { - const NAME: &'static str = "cosmos.tx.v1beta1.Service"; - } -} - -use cosmrs::proto::cosmos::tx::v1beta1::OrderBy; - -/// GetTxsEventRequest is the request type for the Service.TxsByEvents -/// RPC method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetTxsEventRequest { - /// events is the list of transaction event type. - #[prost(string, repeated, tag = "1")] - pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// pagination defines a pagination for the request. - /// Deprecated post v0.46.x: use page and limit instead. - #[deprecated] - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, - #[prost(enumeration = "OrderBy", tag = "3")] - pub order_by: i32, - /// page is the page number to query, starts at 1. If not provided, will default to first page. - #[prost(uint64, tag = "4")] - pub page: u64, - /// limit is the total number of results to be returned in the result page. - /// If left empty it will default to a value to be set by each app. - #[prost(uint64, tag = "5")] - pub limit: u64, - /// query is the new field for passing events in the tendermint format - #[prost(string, tag = "6")] - pub query: ::prost::alloc::string::String, -} diff --git a/cw-orch-daemon/src/lib.rs b/cw-orch-daemon/src/lib.rs index e54333272..18f529eac 100644 --- a/cw-orch-daemon/src/lib.rs +++ b/cw-orch-daemon/src/lib.rs @@ -30,7 +30,6 @@ pub use cw_orch_networks::networks; pub use network_config::read_network_config; pub use senders::{query::QuerySender, tx::TxSender, CosmosOptions, Wallet}; pub use tx_builder::TxBuilder; -mod cosmos_proto_patches; pub(crate) mod cosmos_modules { pub use cosmrs::proto::{ diff --git a/cw-orch-daemon/src/queriers/node.rs b/cw-orch-daemon/src/queriers/node.rs index 825122a52..0958da8a2 100644 --- a/cw-orch-daemon/src/queriers/node.rs +++ b/cw-orch-daemon/src/queriers/node.rs @@ -319,12 +319,12 @@ impl Node { retry_on_empty: bool, retries: usize, ) -> Result, DaemonError> { - let mut client = crate::cosmos_proto_patches::v0_50::tx::service_client::ServiceClient::new( + let mut client = cosmrs::proto::cosmos::tx::v1beta1::service_client::ServiceClient::new( self.channel.clone(), ); #[allow(deprecated)] - let request = crate::cosmos_proto_patches::v0_50::tx::GetTxsEventRequest { + let request = cosmrs::proto::cosmos::tx::v1beta1::GetTxsEventRequest { events: events.clone(), pagination: None, order_by: order_by.unwrap_or(OrderBy::Desc).into(), diff --git a/cw-orch-daemon/tests/authz.rs b/cw-orch-daemon/tests/authz.rs index c117b9428..520444397 100644 --- a/cw-orch-daemon/tests/authz.rs +++ b/cw-orch-daemon/tests/authz.rs @@ -20,7 +20,7 @@ mod tests { use cw_orch_traits::Stargate; use prost::Message; use prost::Name; - use prost_types::{Any, Timestamp}; + use prost_types::Any; pub const SECOND_MNEMONIC: &str ="salute trigger antenna west ignore own dance bounce battle soul girl scan test enroll luggage sorry distance traffic brand keen rich syrup wood repair"; #[test] @@ -57,13 +57,13 @@ mod tests { } .encode_to_vec(), }; - let expiration = Timestamp { + let expiration = cosmrs::proto::Timestamp { seconds: (current_timestamp.seconds() + 3600) as i64, nanos: 0, }; let grant = cosmrs::proto::cosmos::authz::v1beta1::Grant { authorization: Some(authorization.clone()), - expiration: Some(expiration.clone()), + expiration: Some(expiration), }; // We start by granting authz to an account @@ -85,7 +85,7 @@ mod tests { granter: sender.to_string(), grantee: grantee.to_string(), authorization: Some(authorization.clone()), - expiration: Some(expiration.clone()), + expiration: Some(expiration), }; // Grants diff --git a/cw-orch-interchain/Cargo.toml b/cw-orch-interchain/Cargo.toml index 9636924de..46d48e8a6 100644 --- a/cw-orch-interchain/Cargo.toml +++ b/cw-orch-interchain/Cargo.toml @@ -52,4 +52,6 @@ log.workspace = true speculoos.workspace = true tokio = "1.39.2" cosmos-sdk-proto = { workspace = true } +prost-types = { workspace = true } +ibc-proto = { workspace = true } pretty_env_logger = "0.5.0" diff --git a/cw-orch-interchain/examples/timeout_packet.rs b/cw-orch-interchain/examples/timeout_packet.rs index a2cb40b07..d05f9b769 100644 --- a/cw-orch-interchain/examples/timeout_packet.rs +++ b/cw-orch-interchain/examples/timeout_packet.rs @@ -1,16 +1,14 @@ -use cosmos_sdk_proto::{ - ibc::{ - applications::transfer::v1::{MsgTransfer, MsgTransferResponse}, - core::client::v1::Height, - }, - traits::{Message, Name}, - Any, -}; +use cosmos_sdk_proto::traits::{Message, Name}; use cw_orch::{environment::QueryHandler, prelude::*}; use cw_orch_interchain_core::InterchainEnv; use cw_orch_interchain_daemon::ChannelCreator as _; use cw_orch_starship::Starship; +use ibc_proto::ibc::{ + applications::transfer::v1::{MsgTransfer, MsgTransferResponse}, + core::client::v1::Height, +}; use ibc_relayer_types::core::ics24_host::identifier::PortId; +use prost_types::Any; fn main() -> cw_orch::anyhow::Result<()> { pretty_env_logger::init(); @@ -40,7 +38,7 @@ fn main() -> cw_orch::anyhow::Result<()> { value: MsgTransfer { source_port: channel.0.port.to_string(), source_channel: channel.0.channel.unwrap().to_string(), - token: Some(cosmos_sdk_proto::cosmos::base::v1beta1::Coin { + token: Some(ibc_proto::cosmos::base::v1beta1::Coin { amount: "100_000".to_string(), denom: "ujuno".to_string(), }), @@ -51,6 +49,7 @@ fn main() -> cw_orch::anyhow::Result<()> { revision_height: stargaze_height.height, }), timeout_timestamp: 0, + memo: String::new(), } .encode_to_vec(), type_url: MsgTransfer::type_url(), diff --git a/cw-orch/examples/complex_testnet_daemon.rs b/cw-orch/examples/complex_testnet_daemon.rs index a7ad8b185..f1b9d8dd2 100644 --- a/cw-orch/examples/complex_testnet_daemon.rs +++ b/cw-orch/examples/complex_testnet_daemon.rs @@ -1,118 +1,120 @@ -use cosmwasm_std::coins; -use counter_contract::{ - msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg}, - CounterContract, CounterExecuteMsgFns, CounterQueryMsgFns, -}; -use cw_orch::prelude::*; -use cw_orch_traits::Stargate; -use osmosis_std::types::{ - cosmos::base::v1beta1::Coin, - osmosis::tokenfactory::v1beta1::{ - MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, - }, -}; -use prost::Message; -use prost_types::Any; +// TODO: Osmosis haven't bumped prost yet. -pub const SUBDENOM: &str = "complex-test"; +// use cosmwasm_std::coins; +// use counter_contract::{ +// msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg}, +// CounterContract, CounterExecuteMsgFns, CounterQueryMsgFns, +// }; +// use cw_orch::prelude::*; +// use cw_orch_traits::Stargate; +// use osmosis_std::types::{ +// cosmos::base::v1beta1::Coin, +// osmosis::tokenfactory::v1beta1::{ +// MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, +// }, +// }; +// use prost::Message; +// use prost_types::Any; + +// pub const SUBDENOM: &str = "complex-test"; /// In order to use this script, you need to set the following env variables /// RUST_LOG (recommended value `info`) to see the app logs /// TEST_MNEMONIC to be able to sign and broadcast a transaction on UNI testnet pub fn main() { - // We start by loading environment variables from a .env file. - // You can use a .env file to specify environment variables. - // You have an overview of all supported environment variables here : https://orchestrator.abstract.money/contracts/env-variable.html - dotenv::dotenv().unwrap(); + // // We start by loading environment variables from a .env file. + // // You can use a .env file to specify environment variables. + // // You have an overview of all supported environment variables here : https://orchestrator.abstract.money/contracts/env-variable.html + // dotenv::dotenv().unwrap(); - // We initialize the env logger to be able to see what's happening during the script execution - // Remember to set the `RUST_LOG` env variable to be able to see the execution - env_logger::init(); + // // We initialize the env logger to be able to see what's happening during the script execution + // // Remember to set the `RUST_LOG` env variable to be able to see the execution + // env_logger::init(); - // We can now create a daemon. This daemon will be used to interact with the chain. - // In the background, the `build` function uses the `TEST_MNEMONIC` variable, don't forget to set it ! - let daemon = Daemon::builder(cw_orch::daemon::networks::UNI_6) // set the network to use - .build() - .unwrap(); + // // We can now create a daemon. This daemon will be used to interact with the chain. + // // In the background, the `build` function uses the `TEST_MNEMONIC` variable, don't forget to set it ! + // let daemon = Daemon::builder(cw_orch::daemon::networks::UNI_6) // set the network to use + // .build() + // .unwrap(); - // You create a contract interface to be able to identify what you are interacting with - let counter = CounterContract::new(daemon.clone()); + // // You create a contract interface to be able to identify what you are interacting with + // let counter = CounterContract::new(daemon.clone()); - // Uploading a contract is very simple - let upload_res = counter.upload(); - assert!(upload_res.is_ok()); + // // Uploading a contract is very simple + // let upload_res = counter.upload(); + // assert!(upload_res.is_ok()); - let init_res = counter.instantiate( - &InstantiateMsg { count: 0 }, - Some(&counter.environment().sender_addr()), - &[], - ); - assert!(init_res.is_ok()); + // let init_res = counter.instantiate( + // &InstantiateMsg { count: 0 }, + // Some(&counter.environment().sender_addr()), + // &[], + // ); + // assert!(init_res.is_ok()); - // You can execute a message using actual message types - let exec_res = counter.execute(&ExecuteMsg::Increment {}, &[]); - assert!(exec_res.is_ok()); + // // You can execute a message using actual message types + // let exec_res = counter.execute(&ExecuteMsg::Increment {}, &[]); + // assert!(exec_res.is_ok()); - let query_res = counter.query::(&QueryMsg::GetCount {}); - assert!(query_res.is_ok()); + // let query_res = counter.query::(&QueryMsg::GetCount {}); + // assert!(query_res.is_ok()); - // Or you can use even simpler syntax ! - let exec_res = counter.increment(); - assert!(exec_res.is_ok()); + // // Or you can use even simpler syntax ! + // let exec_res = counter.increment(); + // assert!(exec_res.is_ok()); - let query_res = counter.get_count(); - assert!(query_res.is_ok()); + // let query_res = counter.get_count(); + // assert!(query_res.is_ok()); - let sender_addr = daemon.sender_addr().to_string(); - // We create a denom - daemon - .commit_any::( - vec![Any { - type_url: MsgCreateDenom::TYPE_URL.to_string(), - value: MsgCreateDenom { - sender: sender_addr.clone(), - subdenom: SUBDENOM.to_string(), - } - .encode_to_vec(), - }], - None, - ) - .unwrap(); - let denom = format!("factory/{}/{}", sender_addr, SUBDENOM); - // We mint some tokens - daemon - .commit_any::( - vec![Any { - type_url: MsgMint::TYPE_URL.to_string(), - value: MsgMint { - sender: sender_addr.clone(), - amount: Some(Coin { - amount: "100000".to_string(), - denom: denom.clone(), - }), - mint_to_address: sender_addr.clone(), - } - .encode_to_vec(), - }], - None, - ) - .unwrap(); - // We send some funds to the counter contract - let contract_addr = counter.address().unwrap(); - daemon - .rt_handle - .block_on( - daemon - .sender() - .bank_send(&contract_addr, coins(50_000, denom.clone())), - ) - .unwrap(); - // We verify they have received their funds - assert_eq!( - daemon - .bank_querier() - .balance(&contract_addr, Some(denom.clone())) - .unwrap(), - coins(50_000, denom.clone()) - ); + // let sender_addr = daemon.sender_addr().to_string(); + // // We create a denom + // daemon + // .commit_any::( + // vec![Any { + // type_url: MsgCreateDenom::TYPE_URL.to_string(), + // value: MsgCreateDenom { + // sender: sender_addr.clone(), + // subdenom: SUBDENOM.to_string(), + // } + // .encode_to_vec(), + // }], + // None, + // ) + // .unwrap(); + // let denom = format!("factory/{}/{}", sender_addr, SUBDENOM); + // // We mint some tokens + // daemon + // .commit_any::( + // vec![Any { + // type_url: MsgMint::TYPE_URL.to_string(), + // value: MsgMint { + // sender: sender_addr.clone(), + // amount: Some(Coin { + // amount: "100000".to_string(), + // denom: denom.clone(), + // }), + // mint_to_address: sender_addr.clone(), + // } + // .encode_to_vec(), + // }], + // None, + // ) + // .unwrap(); + // // We send some funds to the counter contract + // let contract_addr = counter.address().unwrap(); + // daemon + // .rt_handle + // .block_on( + // daemon + // .sender() + // .bank_send(&contract_addr, coins(50_000, denom.clone())), + // ) + // .unwrap(); + // // We verify they have received their funds + // assert_eq!( + // daemon + // .bank_querier() + // .balance(&contract_addr, Some(denom.clone())) + // .unwrap(), + // coins(50_000, denom.clone()) + // ); } diff --git a/packages/interchain/interchain-core/Cargo.toml b/packages/interchain/interchain-core/Cargo.toml index 3bcaa8ab0..d15cf8142 100644 --- a/packages/interchain/interchain-core/Cargo.toml +++ b/packages/interchain/interchain-core/Cargo.toml @@ -37,3 +37,5 @@ cw-orch-interchain = { path = "../../../cw-orch-interchain", features = [ ] } cw-orch = { workspace = true } cosmos-sdk-proto = { workspace = true } +ibc-proto = { workspace = true } +prost-types = { workspace = true } diff --git a/packages/interchain/interchain-core/src/env.rs b/packages/interchain/interchain-core/src/env.rs index caad61f83..c760eb481 100644 --- a/packages/interchain/interchain-core/src/env.rs +++ b/packages/interchain/interchain-core/src/env.rs @@ -311,13 +311,13 @@ pub trait InterchainEnv { /// ``` rust,no_run /// use cw_orch::prelude::*; /// use cw_orch_interchain::prelude::*; - /// use cosmos_sdk_proto::{ - /// ibc::{ + /// use ibc_proto::ibc::{ /// applications::transfer::v1::{MsgTransfer, MsgTransferResponse}, /// core::client::v1::Height, - /// }, + /// }; + /// use prost_types::Any; + /// use cosmos_sdk_proto::{ /// traits::{Message, Name}, - /// Any, /// }; /// let starship = Starship::new(None).unwrap(); /// let interchain = starship.interchain_env(); @@ -343,7 +343,7 @@ pub trait InterchainEnv { /// value: MsgTransfer { /// source_port: src_channel.0.port.to_string(), /// source_channel: src_channel.0.channel.unwrap().to_string(), - /// token: Some(cosmos_sdk_proto::cosmos::base::v1beta1::Coin { + /// token: Some(ibc_proto::cosmos::base::v1beta1::Coin { /// amount: "100_000".to_string(), /// denom: "osmo".to_string(), /// }), @@ -351,6 +351,7 @@ pub trait InterchainEnv { /// receiver: archway.sender_addr().to_string(), /// timeout_height: None, /// timeout_timestamp: osmosis.block_info().unwrap().time.plus_seconds(600).nanos(), + /// memo: String::new(), /// }.encode_to_vec(), /// type_url: MsgTransfer::type_url(), /// }