Skip to content

0.26.0 version upgrade #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ thiserror = { version = "1.0.64" }
schemars = "0.8"
cw-asset = { version = "4.0.0" }

abstract-app = { version = "0.24.1-beta.2" }
abstract-adapter = { version = "0.24.1-beta.2" }
abstract-standalone = { version = "0.24.1-beta.2" }
abstract-interface = { version = "0.24.1-beta.2" }
abstract-client = { version = "0.24.1-beta.2" }
abstract-app = { version = "0.26.0" }
abstract-adapter = { version = "0.26.0" }
abstract-standalone = { version = "0.26.0" }
abstract-interface = { version = "0.26.0" }
abstract-client = { version = "0.26.0" }
cw-orch = { version = "0.25.1" }

lazy_static = "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion contracts/{{adapter_name}}/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ env_logger = { workspace = true, optional = true }

[dev-dependencies]
{{adapter_name | kebab_case}} = { workspace = true }
abstract-client = { workspace = true }
abstract-client = { workspace = true, features = ["test-utils"] }
abstract-adapter = { workspace = true, features = ["test-utils"] }
4 changes: 2 additions & 2 deletions contracts/{{adapter_name}}/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use cosmwasm_std::{CosmosMsg, Deps, Uint128};
/// Interact with your adapter in other modules.
pub trait {{adapter_name | upper_camel_case}}Api: AccountIdentification + Dependencies + ModuleIdentification {
/// Construct a new adapter interface.
fn {{adapter_name | snake_case}}<'a>(&'a self, deps: Deps<'a>) -> {{adapter_name | upper_camel_case}}<Self> {
fn {{adapter_name | snake_case}}<'a>(&'a self, deps: Deps<'a>) -> {{adapter_name | upper_camel_case}}<'a, Self> {
{{adapter_name | upper_camel_case}} {
base: self,
deps,
Expand Down Expand Up @@ -60,7 +60,7 @@ impl<'a, T: {{adapter_name | upper_camel_case}}Api> {{adapter_name | upper_camel
}

/// Queries
impl<'a, T: {{adapter_name | upper_camel_case}}Api> {{adapter_name | upper_camel_case}}<'a, T> {
impl<T: {{adapter_name | upper_camel_case}}Api> {{adapter_name | upper_camel_case}}<'_, T> {
/// Query your adapter via message type
pub fn query<R: DeserializeOwned>(&self, query_msg: {{adapter_name | upper_camel_case}}QueryMsg) -> AbstractSdkResult<R> {
let adapters = self.base.adapters(self.deps);
Expand Down
8 changes: 4 additions & 4 deletions contracts/{{adapter_name}}/src/handlers/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ pub fn execute_handler(
}

/// Update the configuration of the adapter
fn update_config(deps: DepsMut, env: Env, _msg_info: MessageInfo, module: {{adapter_name | upper_camel_case}}) -> AdapterResult {
fn update_config(deps: DepsMut, _env: Env, _msg_info: MessageInfo, module: {{adapter_name | upper_camel_case}}) -> AdapterResult {
// Only admin(namespace owner) can change recipient address
let namespace = module
.module_registry(deps.as_ref(), &env)?
.module_registry(deps.as_ref())?
.query_namespace(Namespace::new({{project-name | shouty_snake_case}}_NAMESPACE)?)?;

// unwrap namespace, since it's unlikely to have unclaimed namespace as this adapter installed
Expand All @@ -46,8 +46,8 @@ fn update_config(deps: DepsMut, env: Env, _msg_info: MessageInfo, module: {{adap
Ok(module.response("update_config"))
}

fn set_status(deps: DepsMut, env: Env, module: {{adapter_name | upper_camel_case}}, status: String) -> AdapterResult {
let account_registry = module.account_registry(deps.as_ref(), &env)?;
fn set_status(deps: DepsMut, _env: Env, module: {{adapter_name | upper_camel_case}}, status: String) -> AdapterResult {
let account_registry = module.account_registry(deps.as_ref())?;

let account_id = account_registry.account_id(module.target()?)?;
STATUS.save(deps.storage, &account_id, &status)?;
Expand Down
2 changes: 1 addition & 1 deletion contracts/{{adapter_name}}/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl TestEnv<MockBech32> {
let namespace = Namespace::new({{project-name | shouty_snake_case}}_NAMESPACE)?;

// You can set up Abstract with a builder.
let abs_client = AbstractClient::builder(mock).build_mock()?;
let abs_client = AbstractClient::builder(mock).build()?;
// The adapter supports setting balances for addresses and configuring ANS.
abs_client.set_balance(&sender, &coins(123, "ucosm"))?;

Expand Down
2 changes: 1 addition & 1 deletion contracts/{{app_name}}/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ env_logger = { workspace = true, optional = true }

[dev-dependencies]
{{app_name | kebab_case}} = { workspace = true }
abstract-client = { workspace = true }
abstract-client = { workspace = true, features = ["test-utils"] }
abstract-app = { workspace = true, features = ["test-utils"] }
2 changes: 1 addition & 1 deletion contracts/{{app_name}}/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl TestEnv<MockBech32> {
let namespace = Namespace::new({{project-name | shouty_snake_case}}_NAMESPACE)?;

// You can set up Abstract with a builder.
let abs_client = AbstractClient::builder(mock).build_mock()?;
let abs_client = AbstractClient::builder(mock).build()?;
// The app supports setting balances for addresses and configuring ANS.
abs_client.set_balance(&sender, &coins(123, "ucosm"))?;

Expand Down
2 changes: 1 addition & 1 deletion contracts/{{standalone_name}}/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ env_logger = { workspace = true, optional = true }

[dev-dependencies]
{{standalone_name | kebab_case}} = { path = "." }
abstract-client = { workspace = true }
abstract-client = { workspace = true, features = ["test-utils"] }
abstract-standalone = { workspace = true, features = ["test-utils"] }
2 changes: 1 addition & 1 deletion contracts/{{standalone_name}}/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn execute(
{{standalone_name | upper_camel_case}}ExecuteMsg::Reset { count } => reset(deps, env, info, count, standalone),
{{standalone_name | upper_camel_case}}ExecuteMsg::IbcCallback(msg) => {
let binding = {{standalone_name | shouty_snake_case}};
let ibc_client = binding.ibc_client(deps.as_ref(), &env);
let ibc_client = binding.ibc_client(deps.as_ref());

let ibc_client_addr = ibc_client.module_address()?;
if info.sender.ne(&ibc_client_addr) {
Expand Down
4 changes: 2 additions & 2 deletions contracts/{{standalone_name}}/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use {{standalone_name | snake_case}}::{
};

use abstract_client::{AbstractClient, Application, Environment};
use abstract_standalone::{objects::namespace::Namespace};
use abstract_standalone::objects::namespace::Namespace;
use cosmwasm_std::coins;
// Use prelude to get all the necessary imports
use cw_orch::{anyhow, prelude::*};
Expand All @@ -27,7 +27,7 @@ impl TestEnv<MockBech32> {
let namespace = Namespace::new({{project-name | shouty_snake_case}}_NAMESPACE)?;

// You can set up Abstract with a builder.
let abs_client = AbstractClient::builder(mock).build_mock()?;
let abs_client = AbstractClient::builder(mock).build()?;
// The standalone supports setting balances for addresses and configuring ANS.
abs_client.set_balance(&sender, &coins(123, "ucosm"))?;

Expand Down
Loading