diff --git a/contracts/factory/src/tests/config.rs b/contracts/factory/src/tests/config.rs index ddced1c6d..e0eaa31a6 100644 --- a/contracts/factory/src/tests/config.rs +++ b/contracts/factory/src/tests/config.rs @@ -36,7 +36,7 @@ fn factory_successfully_inits_multihop() { let multihop_address = factory.get_config().multihop_address; - assert!(multihop_address.to_string().len() != 0); + assert!(!multihop_address.to_string().is_empty()); } #[test] diff --git a/contracts/factory/src/tests/queries.rs b/contracts/factory/src/tests/queries.rs index 073ee2331..ff78d2e93 100644 --- a/contracts/factory/src/tests/queries.rs +++ b/contracts/factory/src/tests/queries.rs @@ -446,14 +446,26 @@ fn test_query_user_portfolio_with_stake() { let user_1 = Address::generate(&env); let user_2 = Address::generate(&env); - let mut token1 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token2 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token3 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token4 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); + let mut token1 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token2 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token3 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token4 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); env.mock_all_auths(); env.budget().reset_unlimited(); @@ -682,14 +694,26 @@ fn test_query_user_portfolio_with_multiple_users_staking_in_multiple_liquidity_p let user_1 = Address::generate(&env); let user_2 = Address::generate(&env); - let mut token1 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token2 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token3 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token4 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); + let mut token1 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token2 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token3 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token4 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); env.mock_all_auths(); env.budget().reset_unlimited(); @@ -1207,10 +1231,16 @@ fn test_query_user_portfolio_without_stake() { let manager = Address::generate(&env); let user_1 = Address::generate(&env); - let mut token1 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); - let mut token2 = - token_contract::Client::new(&env, &env.register_stellar_asset_contract(admin.clone())); + let mut token1 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); + let mut token2 = token_contract::Client::new( + &env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ); env.mock_all_auths(); env.budget().reset_unlimited(); diff --git a/contracts/multihop/src/tests/setup.rs b/contracts/multihop/src/tests/setup.rs index 8940bc8a4..7a73dbee6 100644 --- a/contracts/multihop/src/tests/setup.rs +++ b/contracts/multihop/src/tests/setup.rs @@ -35,7 +35,11 @@ pub fn install_token_wasm(env: &Env) -> BytesN<32> { } pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::Client<'a> { - token_contract::Client::new(env, &env.register_stellar_asset_contract(admin.clone())) + token_contract::Client::new( + env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ) } #[allow(clippy::too_many_arguments)] diff --git a/contracts/pool/src/tests/setup.rs b/contracts/pool/src/tests/setup.rs index 674ec436e..8f48312b6 100644 --- a/contracts/pool/src/tests/setup.rs +++ b/contracts/pool/src/tests/setup.rs @@ -8,7 +8,11 @@ use crate::{ use phoenix::utils::{LiquidityPoolInitInfo, StakeInitInfo, TokenInitInfo}; pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::Client<'a> { - token_contract::Client::new(env, &env.register_stellar_asset_contract(admin.clone())) + token_contract::Client::new( + env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ) } pub fn install_token_wasm(env: &Env) -> BytesN<32> { diff --git a/contracts/pool_stable/src/tests/setup.rs b/contracts/pool_stable/src/tests/setup.rs index 1ebd13e4b..f7ca2fe3e 100644 --- a/contracts/pool_stable/src/tests/setup.rs +++ b/contracts/pool_stable/src/tests/setup.rs @@ -8,7 +8,11 @@ use crate::{ use phoenix::utils::{LiquidityPoolInitInfo, StakeInitInfo, TokenInitInfo}; pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::Client<'a> { - token_contract::Client::new(env, &env.register_stellar_asset_contract(admin.clone())) + token_contract::Client::new( + env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ) } pub fn install_token_wasm(env: &Env) -> BytesN<32> { diff --git a/contracts/stake/src/tests/setup.rs b/contracts/stake/src/tests/setup.rs index 18b11dad4..861246cb6 100644 --- a/contracts/stake/src/tests/setup.rs +++ b/contracts/stake/src/tests/setup.rs @@ -6,7 +6,11 @@ use crate::{ }; pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::Client<'a> { - token_contract::Client::new(env, &env.register_stellar_asset_contract(admin.clone())) + token_contract::Client::new( + env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ) } #[allow(clippy::too_many_arguments)] diff --git a/contracts/stake_rewards/src/tests/setup.rs b/contracts/stake_rewards/src/tests/setup.rs index e7025180a..ba9ffd01e 100644 --- a/contracts/stake_rewards/src/tests/setup.rs +++ b/contracts/stake_rewards/src/tests/setup.rs @@ -6,7 +6,11 @@ use crate::{ }; pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::Client<'a> { - token_contract::Client::new(env, &env.register_stellar_asset_contract(admin.clone())) + token_contract::Client::new( + env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ) } const MIN_BOND: i128 = 1000; diff --git a/contracts/vesting/src/tests/setup.rs b/contracts/vesting/src/tests/setup.rs index e875806a8..00d7613cf 100644 --- a/contracts/vesting/src/tests/setup.rs +++ b/contracts/vesting/src/tests/setup.rs @@ -10,5 +10,9 @@ pub fn instantiate_vesting_client(env: &Env) -> VestingClient { } pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::Client<'a> { - token_contract::Client::new(env, &env.register_stellar_asset_contract(admin.clone())) + token_contract::Client::new( + env, + &env.register_stellar_asset_contract_v2(admin.clone()) + .address(), + ) }