diff --git a/contracts/client/examples/local_daemon.rs b/contracts/client/examples/local_daemon.rs index 6d26fe5..534ab40 100644 --- a/contracts/client/examples/local_daemon.rs +++ b/contracts/client/examples/local_daemon.rs @@ -38,7 +38,11 @@ fn main() -> anyhow::Result<()> { // Get the [`Publisher`] that owns the namespace. // If there isn't one, it creates an Account and claims the namespace. - let publisher: Publisher<_> = abstract_client.publisher_builder(app_namespace).build()?; + let publisher_acc = abstract_client + .fetch_or_build_account(app_namespace.clone(), |builder| { + builder.namespace(app_namespace) + })?; + let publisher: Publisher<_> = Publisher::new(&publisher_acc)?; // Ensure the current sender owns the namespace if publisher.account().owner()? != daemon.sender().address() { diff --git a/contracts/client/examples/publish.rs b/contracts/client/examples/publish.rs index 8bc7d66..86bb2f8 100644 --- a/contracts/client/examples/publish.rs +++ b/contracts/client/examples/publish.rs @@ -8,7 +8,6 @@ //! $ just publish uni-6 osmo-test-5 //! ``` -use abstract_app::objects::module::ModuleVersion; use abstract_app::objects::namespace::Namespace; use abstract_client::{AbstractClient, Publisher}; use clap::Parser; @@ -35,7 +34,10 @@ fn publish(networks: Vec) -> anyhow::Result<()> { let abstract_client: AbstractClient = AbstractClient::new(chain.clone())?; // Get the [`Publisher`] that owns the namespace, otherwise create a new one and claim the namespace - let publisher_acc = abstract_client.fetch_or_build_account(app_namespace.clone(), |builder| builder.namespace(app_namespace))?; + let publisher_acc = abstract_client + .fetch_or_build_account(app_namespace.clone(), |builder| { + builder.namespace(app_namespace) + })?; let publisher = Publisher::new(&publisher_acc)?; if publisher.account().owner()? != chain.sender().address() { diff --git a/contracts/server/examples/local_daemon.rs b/contracts/server/examples/local_daemon.rs index 229c5a6..cac43aa 100644 --- a/contracts/server/examples/local_daemon.rs +++ b/contracts/server/examples/local_daemon.rs @@ -38,7 +38,11 @@ fn main() -> anyhow::Result<()> { // Get the [`Publisher`] that owns the namespace. // If there isn't one, it creates an Account and claims the namespace. - let publisher: Publisher<_> = abstract_client.publisher_builder(app_namespace).build()?; + let publisher_acc = abstract_client + .fetch_or_build_account(app_namespace.clone(), |builder| { + builder.namespace(app_namespace) + })?; + let publisher: Publisher<_> = Publisher::new(&publisher_acc)?; // Ensure the current sender owns the namespace if publisher.account().owner()? != daemon.sender().address() { diff --git a/contracts/server/examples/publish.rs b/contracts/server/examples/publish.rs index b4025d7..9fdf88b 100644 --- a/contracts/server/examples/publish.rs +++ b/contracts/server/examples/publish.rs @@ -34,7 +34,10 @@ fn publish(networks: Vec) -> anyhow::Result<()> { let abstract_client: AbstractClient = AbstractClient::new(chain.clone())?; // Get the [`Publisher`] that owns the namespace, otherwise create a new one and claim the namespace - let publisher_acc = abstract_client.fetch_or_build_account(app_namespace.clone(), |builder| builder.namespace(app_namespace))?; + let publisher_acc = abstract_client + .fetch_or_build_account(app_namespace.clone(), |builder| { + builder.namespace(app_namespace) + })?; let publisher = Publisher::new(&publisher_acc)?; if publisher.account().owner()? != chain.sender().address() { diff --git a/packages/ibcmail/src/server/msg.rs b/packages/ibcmail/src/server/msg.rs index 929df0c..2e185ef 100644 --- a/packages/ibcmail/src/server/msg.rs +++ b/packages/ibcmail/src/server/msg.rs @@ -25,20 +25,18 @@ pub enum ServerExecuteMsg { #[cosmwasm_schema::cw_serde] pub enum ServerIbcMessage { /// Route a message - RouteMessage { msg: IbcMailMessage, header: Header } + RouteMessage { msg: IbcMailMessage, header: Header }, } /// App query messages #[cosmwasm_schema::cw_serde] -#[derive(QueryResponses)] -#[derive(cw_orch::QueryFns)] +#[derive(QueryResponses, cw_orch::QueryFns)] // #[cw_orch(impl_into(QueryMsg))] pub enum ServerQueryMsg { #[returns(ConfigResponse)] - Config {} + Config {}, } - // impl From for QueryMsg { // fn from(msg: ServerQueryMsg) -> Self { // QueryMsg::Module(msg) diff --git a/tests/src/bin/approve.rs b/tests/src/bin/approve.rs index ac396ca..63722af 100644 --- a/tests/src/bin/approve.rs +++ b/tests/src/bin/approve.rs @@ -13,8 +13,7 @@ use abstract_interface::Abstract; use clap::Parser; use cw_orch::{ anyhow, - environment::TxHandler, - prelude::{*, DaemonBuilder, networks::parse_network}, + prelude::{networks::parse_network, DaemonBuilder, *}, tokio::runtime::Runtime, }; @@ -32,7 +31,8 @@ fn publish(networks: Vec) -> anyhow::Result<()> { // Create an [`AbstractClient`] let abs = Abstract::new(chain.clone()); - abs.registry.approve_all_modules_for_namespace(app_namespace)?; + abs.registry + .approve_all_modules_for_namespace(app_namespace)?; } Ok(()) } diff --git a/tests/src/bin/demo.rs b/tests/src/bin/demo.rs index cf9b5ab..9fb8f23 100644 --- a/tests/src/bin/demo.rs +++ b/tests/src/bin/demo.rs @@ -16,8 +16,7 @@ const SRC: ChainInfo = PION_1; const DST: ChainInfo = HARPOON_4; fn test() -> anyhow::Result<()> { - let interchain = - DaemonInterchain::new(vec![SRC, DST], &ChannelCreationValidator)?; + let interchain = DaemonInterchain::new(vec![SRC, DST], &ChannelCreationValidator)?; let src = interchain.get_chain(SRC.chain_id)?; let dst = interchain.get_chain(DST.chain_id)?; diff --git a/tests/src/bin/full_demo.rs b/tests/src/bin/full_demo.rs index 4dcffd1..97ee3c8 100644 --- a/tests/src/bin/full_demo.rs +++ b/tests/src/bin/full_demo.rs @@ -8,8 +8,8 @@ use abstract_app::{ }, std::{ ibc_client::QueryMsgFns as IbcQueryFns, - IBC_HOST, registry::{ExecuteMsgFns, ModuleFilter, QueryMsgFns}, + IBC_HOST, }, }; use abstract_client::AbstractClient; @@ -21,16 +21,15 @@ use cw_orch_interchain::prelude::*; use networks::{HARPOON_4, PION_1}; use client::ClientInterface; -use ibcmail::{client::msg::ClientExecuteMsgFns, IBCMAIL_NAMESPACE, Message}; +use ibcmail::{client::msg::ClientExecuteMsgFns, Message, IBCMAIL_NAMESPACE}; use tests::TEST_NAMESPACE; const SRC: ChainInfo = HARPOON_4; const DST: ChainInfo = PION_1; fn test() -> anyhow::Result<()> { - let rt = Runtime::new()?; - let interchain = - DaemonInterchain::new(vec![SRC, DST], &ChannelCreationValidator)?; + let _rt = Runtime::new()?; + let interchain = DaemonInterchain::new(vec![SRC, DST], &ChannelCreationValidator)?; let src = interchain.get_chain(SRC.chain_id)?; let dst = interchain.get_chain(DST.chain_id)?; @@ -70,9 +69,9 @@ fn test() -> anyhow::Result<()> { // src_acc.install_app_with_dependencies::>(&ClientInstantiateMsg {}, Empty {}, &[])?; // let app = src_acc.install_app_with_dependencies::>(&ClientInstantiateMsg {}, Empty {},&[])?; - let app = src_acc.application::>()?; + let _app = src_acc.application::>()?; // app.authorize_on_adapters(&[IBCMAIL_SERVER_ID])?; - let src_client = src_acc.application::>()?; + let _src_client = src_acc.application::>()?; let dst_acc = abs_dst .account_builder() @@ -85,7 +84,7 @@ fn test() -> anyhow::Result<()> { // &[], // )?; - let app = dst_acc.application::>()?; + let _app = dst_acc.application::>()?; // app.authorize_on_adapters(&[IBCMAIL_SERVER_ID])?; let dst_client = dst_acc.application::>()?; diff --git a/tests/src/client.rs b/tests/src/client.rs index 0a13050..d2f3f0b 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -1,13 +1,13 @@ -use abstract_app::objects::{AccountId, namespace::Namespace}; -use abstract_client::{AbstractClient, Application, Environment}; +use abstract_app::objects::{namespace::Namespace, AccountId}; +use abstract_client::{AbstractClient, Application, Publisher}; use cw_orch::{anyhow, prelude::*}; use speculoos::prelude::*; // Use prelude to get all the necessary imports -use client::{*, contract::interface::ClientInterface, msg::ClientInstantiateMsg}; +use client::{contract::interface::ClientInterface, msg::ClientInstantiateMsg, *}; use ibcmail::{ - IBCMAIL_NAMESPACE, IBCMAIL_SERVER_ID, IbcMailMessage, Message, Recipient, - Sender, server::msg::ServerInstantiateMsg, + server::msg::ServerInstantiateMsg, IbcMailMessage, Message, Recipient, Sender, + IBCMAIL_NAMESPACE, IBCMAIL_SERVER_ID, }; use server::ServerInterface; @@ -32,14 +32,14 @@ impl TestEnv { // abs_client.set_balance(sender, &coins(123, "ucosm"))?; // Publish both the client and the server - let publisher = abs_client.publisher_builder(namespace).build()?; + let publisher_acc = abs_client + .fetch_or_build_account(namespace.clone(), |builder| builder.namespace(namespace))?; + let publisher: Publisher<_> = Publisher::new(&publisher_acc)?; publisher.publish_app::>()?; publisher .publish_adapter::>(ServerInstantiateMsg {})?; - let acc = abs_client - .account_builder() - .build()?; + let acc = abs_client.account_builder().build()?; let app = acc.install_app_with_dependencies::>( &ClientInstantiateMsg {}, @@ -49,9 +49,7 @@ impl TestEnv { app.authorize_on_adapters(&[IBCMAIL_SERVER_ID])?; // acc.install_adapter::>(&[])?; - let acc2 = abs_client - .account_builder() - .build()?; + let acc2 = abs_client.account_builder().build()?; let app2 = acc2.install_app_with_dependencies::>( &ClientInstantiateMsg {}, Empty {}, @@ -86,7 +84,7 @@ fn create_test_message(from: AccountId, to: AccountId) -> IbcMailMessage { mod receive_msg { use speculoos::assert_that; - use ibcmail::{IBCMAIL_SERVER_ID, MessageStatus}; + use ibcmail::{MessageStatus, IBCMAIL_SERVER_ID}; use super::*; @@ -149,11 +147,11 @@ mod receive_msg { mod send_msg { use std::str::FromStr; - use abstract_app::{objects::account::AccountTrace, std::registry::ExecuteMsgFns}; use abstract_app::objects::TruncatedChainId; - use cw_orch_interchain::{InterchainEnv, MockBech32InterchainEnv}; + use abstract_app::{objects::account::AccountTrace, std::registry::ExecuteMsgFns}; + use cw_orch_interchain::prelude::*; - use ibcmail::{IBCMAIL_CLIENT_ID, Message, MessageStatus, server::error::ServerError}; + use ibcmail::{server::error::ServerError, Message, MessageStatus, IBCMAIL_CLIENT_ID}; use super::*; diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 3ebb49e..8fd0181 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -1,4 +1,4 @@ #[cfg(test)] mod client; -pub const TEST_NAMESPACE: &str = "ibcmail-demo"; \ No newline at end of file +pub const TEST_NAMESPACE: &str = "ibcmail-demo";