diff --git a/contracts/{{adapter_name}}/src/bin/publish.rs b/contracts/{{adapter_name}}/src/bin/publish.rs index ba92be0..76cdcb7 100644 --- a/contracts/{{adapter_name}}/src/bin/publish.rs +++ b/contracts/{{adapter_name}}/src/bin/publish.rs @@ -30,11 +30,11 @@ fn publish(networks: Vec) -> anyhow::Result<()> { // Create an [`AbstractClient`] 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_account(adapter_namespace)?; + // Get the [`Account`] that owns the namespace, otherwise create a new one and claim the namespace + let publisher_acc = abstract_client.fetch_or_build_account(adapter_namespace, |builder| builder.namespace(Namespace::from_id({{adapter_name | shouty_snake_case}}_ID).unwrap()))?; - // Get the [`Publisher`] that owns the namespace, otherwise create a new one and claim the namespace - let publisher: Publisher<_> = Publisher::new(&publisher_acc)?; + // Get the [`Publisher`] + let publisher: Publisher<_> = publisher_acc.publisher()?; if publisher.account().owner()? != chain.sender_addr() { panic!("The current sender can not publish to this namespace. Please use the wallet that owns the Account that owns the Namespace.") diff --git a/contracts/{{adapter_name}}/tests/integration.rs b/contracts/{{adapter_name}}/tests/integration.rs index ea926cd..061299b 100644 --- a/contracts/{{adapter_name}}/tests/integration.rs +++ b/contracts/{{adapter_name}}/tests/integration.rs @@ -31,7 +31,11 @@ impl TestEnv { abs_client.set_balance(&sender, &coins(123, "ucosm"))?; // Publish the adapter - let publisher = abs_client.publisher_builder(namespace).build()?; + let publisher = abs_client + .account_builder() + .namespace(namespace) + .build()? + .publisher()?; publisher.publish_adapter::<{{adapter_name | upper_camel_case}}InstantiateMsg, {{adapter_name | upper_camel_case}}Interface<_>>( {{adapter_name | upper_camel_case}}InstantiateMsg {}, )?; @@ -67,8 +71,8 @@ fn update_config() -> anyhow::Result<()> { // Note that it's not a requirement to have it installed in this case let publisher_account = env .abs - .publisher_builder(Namespace::new({{project-name | shouty_snake_case}}_NAMESPACE).unwrap()) - .build()?; + .fetch_account(Namespace::new({{project-name | shouty_snake_case}}_NAMESPACE).unwrap())? + .publisher()?; adapter.execute( &AdapterRequestMsg { @@ -109,7 +113,7 @@ fn set_status() -> anyhow::Result<()> { let new_account = env .abs .account_builder() - .install_adapter::<{{adapter_name | upper_camel_case}}Interface>()? + .install_adapter::<{{adapter_name | upper_camel_case}}Interface>() .build()?; new_account.as_ref().execute_on_module( diff --git a/contracts/{{app_name}}/src/bin/publish.rs b/contracts/{{app_name}}/src/bin/publish.rs index 1702105..68b21cf 100644 --- a/contracts/{{app_name}}/src/bin/publish.rs +++ b/contracts/{{app_name}}/src/bin/publish.rs @@ -29,11 +29,11 @@ fn publish(networks: Vec) -> anyhow::Result<()> { // Create an [`AbstractClient`] 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_account(app_namespace)?; + // Get the [`Account`] that owns the namespace, otherwise create a new one and claim the namespace + let publisher_acc = abstract_client.fetch_or_build_account(app_namespace, |builder| builder.namespace(Namespace::from_id({{app_name | shouty_snake_case}}_ID).unwrap()))?; - // Get the [`Publisher`] that owns the namespace, otherwise create a new one and claim the namespace - let publisher: Publisher<_> = Publisher::new(&publisher_acc)?; + // Get the [`Publisher`] + let publisher: Publisher<_> = publisher_acc.publisher()?; if publisher.account().owner()? != chain.sender_addr() { panic!("The current sender can not publish to this namespace. Please use the wallet that owns the Account that owns the Namespace.") diff --git a/contracts/{{app_name}}/tests/integration.rs b/contracts/{{app_name}}/tests/integration.rs index 22ec346..e25a77b 100644 --- a/contracts/{{app_name}}/tests/integration.rs +++ b/contracts/{{app_name}}/tests/integration.rs @@ -32,7 +32,11 @@ impl TestEnv { abs_client.set_balance(&sender, &coins(123, "ucosm"))?; // Publish the app - let publisher = abs_client.publisher_builder(namespace).build()?; + let publisher = abs_client + .account_builder() + .namespace(namespace) + .build()? + .publisher()?; publisher.publish_app::<{{app_name | upper_camel_case}}Interface<_>>()?; let app = publisher diff --git a/contracts/{{standalone_name}}/src/bin/publish.rs b/contracts/{{standalone_name}}/src/bin/publish.rs index 195518d..d236582 100644 --- a/contracts/{{standalone_name}}/src/bin/publish.rs +++ b/contracts/{{standalone_name}}/src/bin/publish.rs @@ -29,11 +29,11 @@ fn publish(networks: Vec) -> anyhow::Result<()> { // Create an [`AbstractClient`] 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_account(standalone_namespace)?; + // Get the [`Account`] that owns the namespace, otherwise create a new one and claim the namespace + let publisher_acc = abstract_client.fetch_or_build_account(standalone_namespace, |builder| builder.namespace(Namespace::from_id({{standalone_name | shouty_snake_case}}_ID).unwrap()))?; - // Get the [`Publisher`] that owns the namespace, otherwise create a new one and claim the namespace - let publisher: Publisher<_> = Publisher::new(&publisher_acc)?; + // Get the [`Publisher`] + let publisher: Publisher<_> = publisher_acc.publisher()?; if publisher.account().owner()? != chain.sender_addr() { panic!("The current sender can not publish to this namespace. Please use the wallet that owns the Account that owns the Namespace.") diff --git a/contracts/{{standalone_name}}/tests/integration.rs b/contracts/{{standalone_name}}/tests/integration.rs index e86ec09..82a63f5 100644 --- a/contracts/{{standalone_name}}/tests/integration.rs +++ b/contracts/{{standalone_name}}/tests/integration.rs @@ -32,7 +32,11 @@ impl TestEnv { abs_client.set_balance(&sender, &coins(123, "ucosm"))?; // Publish the standalone - let publisher = abs_client.publisher_builder(namespace).build()?; + let publisher = abs_client + .account_builder() + .namespace(namespace) + .build()? + .publisher()?; publisher.publish_standalone::<{{standalone_name | upper_camel_case}}Interface<_>>()?; let standalone = publisher