Skip to content
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

Replace calls of deprecated functions #800

Merged
merged 1 commit into from
Aug 21, 2024
Merged
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
3 changes: 3 additions & 0 deletions scripts/git/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ check_lint() {
}

update_schemas osmosis lst-dex-adapter-osmosis
update_schemas osmosis lst-adapter-osmosis
update_schemas osmosis dex-router-osmosis
update_schemas osmosis token-burner
update_schemas osmosis cl-vault
update_schemas osmosis merkle-incentives
update_schemas osmosis range-middleware
fix_formatting osmosis/contracts/lst-dex-adapter-osmosis
fix_formatting osmosis/contracts/lst-adapter-osmosis
fix_formatting osmosis/contracts/dex-router-osmosis
fix_formatting osmosis/contracts/token-burner
fix_formatting osmosis/contracts/cl-vault
Expand All @@ -89,6 +91,7 @@ fix_formatting osmosis/contracts/range-middleware
fix_formatting osmosis/packages/quasar-types
fix_formatting quasar/proto-build
check_lint osmosis/contracts/lst-dex-adapter-osmosis
check_lint osmosis/contracts/lst-adapter-osmosis
check_lint osmosis/contracts/dex-router-osmosis
check_lint osmosis/contracts/token-burner
check_lint osmosis/contracts/cl-vault
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --bin schema --features=schema"
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use abstract_std::objects::UncheckedChannelEntry;
use abstract_std::objects::{account::AccountTrace, chain_name::ChainName, AccountId};
use abstract_std::ICS20;
use cosmwasm_std::Decimal;
use cw_orch::environment::Environment;
use cw_orch::mock::cw_multi_test::MockApiBech32;
use cw_orch::mock::MockBase;
use cw_orch::{anyhow, prelude::*};
Expand Down Expand Up @@ -57,8 +58,8 @@ pub fn create_test_remote_account<Chain: IbcQueryHandler, IBC: InterchainEnv<Cha
abstract_std::objects::gov_type::GovernanceDetails::Monarchy {
monarch: abstr_origin
.version_control
.get_chain()
.sender()
.environment()
.sender_addr()
.to_string(),
},
funds.as_deref(),
Expand Down Expand Up @@ -90,10 +91,10 @@ pub fn abstract_ibc_connection_with<Chain: IbcQueryHandler, IBC: InterchainEnv<C
polytone_src: &Polytone<Chain>,
) -> Result<(), InterchainError> {
// First we register client and host respectively
let chain1_id = abstr.ibc.client.get_chain().chain_id();
let chain1_id = abstr.ibc.client.environment().chain_id();
let chain1_name = ChainName::from_chain_id(&chain1_id);

let chain2_id = dest.ibc.client.get_chain().chain_id();
let chain2_id = dest.ibc.client.environment().chain_id();
let chain2_name = ChainName::from_chain_id(&chain2_id);

// First, we register the host with the client.
Expand Down Expand Up @@ -163,9 +164,9 @@ pub fn ibc_abstract_setup<Chain: IbcQueryHandler, IBC: InterchainEnv<Chain>>(

// Deploying abstract and the IBC abstract logic
let abstr_origin =
Abstract::deploy_on(origin_chain.clone(), origin_chain.sender().to_string())?;
Abstract::deploy_on(origin_chain.clone(), origin_chain.sender_addr().to_string())?;
let abstr_remote =
Abstract::deploy_on(remote_chain.clone(), remote_chain.sender().to_string())?;
Abstract::deploy_on(remote_chain.clone(), remote_chain.sender_addr().to_string())?;

// Deploying polytone on both chains
Polytone::deploy_on(origin_chain.clone(), None)?;
Expand Down Expand Up @@ -201,18 +202,18 @@ pub fn create_app(sender_balance: Vec<Coin>, vault: Option<String>) -> anyhow::R
let vault = if let Some(vault) = vault {
mock.chain(OSMOSIS)?.addr_make(vault)
} else {
mock.chain(OSMOSIS)?.sender()
mock.chain(OSMOSIS)?.sender_addr()
};
let owner = mock.chain(OSMOSIS)?.sender();
let owner = mock.chain(OSMOSIS)?.sender_addr();

if !sender_balance.is_empty() {
mock.chain(OSMOSIS)?
.set_balance(&mock.chain(OSMOSIS)?.sender(), sender_balance)?;
.set_balance(&mock.chain(OSMOSIS)?.sender_addr(), sender_balance)?;
}

let app = LstAdapterInterface::new(
LST_ADAPTER_OSMOSIS_ID,
abstr_origin.version_control.get_chain().clone(),
abstr_origin.version_control.environment().clone(),
);

abstr_origin.version_control.claim_namespace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ fn test_claim_multiple_deposits_and_random_donation() -> anyhow::Result<()> {
assert_eq!(app.balance_in_underlying()?, expected_contract_balance);

assert!(app.claim().is_ok());
let claimed = osmosis.query_balance(&osmosis.sender(), DENOM)?;
let claimed = osmosis.query_balance(&osmosis.sender_addr(), DENOM)?;
assert_eq!(claimed, redeemable0 + donation);

assert_eq!(app.balance_in_underlying()?, redeemable1);
Expand Down Expand Up @@ -303,7 +303,7 @@ fn test_claim_works_unbond_is_finished_and_funds_are_available() -> anyhow::Resu
assert_eq!(app.balance_in_underlying()?, total_redeem_amount);

assert!(app.claim().is_ok());
let balance = osmosis.query_balance(&osmosis.sender(), DENOM)?;
let balance = osmosis.query_balance(&osmosis.sender_addr(), DENOM)?;
assert_eq!(balance, underlying_balance);

let expected_contract_balance = Uint128::zero();
Expand Down
Loading