Skip to content

Commit

Permalink
Use register_stellar_asset_contract_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Aug 21, 2024
1 parent 0591c35 commit 00845e8
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions atomic_multiswap/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use token::Client as TokenClient;
use token::StellarAssetClient as TokenAdminClient;

fn create_token_contract<'a>(e: &Env, admin: &Address) -> (TokenClient<'a>, TokenAdminClient<'a>) {
let contract_address = e.register_stellar_asset_contract(admin.clone());
let sac = e.register_stellar_asset_contract_v2(admin.clone());
(
TokenClient::new(e, &contract_address),
TokenAdminClient::new(e, &contract_address),
token::Client::new(e, &sac.address()),
token::StellarAssetClient::new(e, &sac.address()),
)
}

Expand Down
6 changes: 3 additions & 3 deletions atomic_swap/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use token::Client as TokenClient;
use token::StellarAssetClient as TokenAdminClient;

fn create_token_contract<'a>(e: &Env, admin: &Address) -> (TokenClient<'a>, TokenAdminClient<'a>) {
let contract_address = e.register_stellar_asset_contract(admin.clone());
let sac = e.register_stellar_asset_contract_v2(admin.clone());
(
TokenClient::new(e, &contract_address),
TokenAdminClient::new(e, &contract_address),
token::Client::new(e, &sac.address()),
token::StellarAssetClient::new(e, &sac.address()),
)
}

Expand Down
3 changes: 2 additions & 1 deletion fuzzing/fuzz/fuzz_targets/fuzz_target_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ fuzz_target!(|input: Input| {
let claimant_address = Address::generate(&env);
let token_admin = Address::generate(&env);

let token_contract_id = env.register_stellar_asset_contract(token_admin.clone());
let sac = env.register_stellar_asset_contract_v2(token_admin.clone());
let token_contract_id = sac.address();
let token_client = TokenClient::new(&env, &token_contract_id);
let token_admin_client = TokenAdminClient::new(&env, &token_contract_id);

Expand Down
3 changes: 2 additions & 1 deletion fuzzing/fuzz/fuzz_targets/fuzz_target_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ impl Config {
_ => None,
});

let token_contract_id = env.register_stellar_asset_contract(token_admin.clone());
let sac = env.register_stellar_asset_contract_v2(token_admin.clone());
let token_contract_id = sac.address();
let timelock_contract_id = env.register_contract(None, ClaimableBalanceContract {});

if let Some((depositor_address, _, _)) = &deposit_info {
Expand Down
3 changes: 2 additions & 1 deletion fuzzing/src/proptest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ proptest! {
let claimant_address = Address::generate(&env);
let token_admin = Address::generate(&env);

let token_contract_id = env.register_stellar_asset_contract(token_admin.clone());
let sac = env.register_stellar_asset_contract_v2(token_admin.clone());
let token_contract_id = sac.address();
let token_client = TokenClient::new(&env, &token_contract_id);
let token_admin_client = TokenAdminClient::new(&env, &token_contract_id);

Expand Down
2 changes: 1 addition & 1 deletion liquidity_pool/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use soroban_sdk::{
};

fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> {
token::Client::new(e, &e.register_stellar_asset_contract(admin.clone()))
token::Client::new(e, &e.register_stellar_asset_contract_v2(admin.clone()).address())
}

fn create_liqpool_contract<'a>(
Expand Down
2 changes: 1 addition & 1 deletion mint-lock/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn test() {

mint_lock_client.set_admin(&admin);

let token = env.register_stellar_asset_contract(mint_lock.clone());
let token = env.register_stellar_asset_contract_v2(mint_lock.clone()).address();
let token_client = TokenClient::new(&env, &token);

// Admin can always mint.
Expand Down
6 changes: 3 additions & 3 deletions single_offer/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ fn create_token_contract<'a>(
e: &Env,
admin: &Address,
) -> (token::Client<'a>, token::StellarAssetClient<'a>) {
let addr = e.register_stellar_asset_contract(admin.clone());
let sac = e.register_stellar_asset_contract_v2(admin.clone());
(
token::Client::new(e, &addr),
token::StellarAssetClient::new(e, &addr),
token::Client::new(e, &sac.address()),
token::StellarAssetClient::new(e, &sac.address()),
)
}

Expand Down
6 changes: 3 additions & 3 deletions timelock/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use token::Client as TokenClient;
use token::StellarAssetClient as TokenAdminClient;

fn create_token_contract<'a>(e: &Env, admin: &Address) -> (TokenClient<'a>, TokenAdminClient<'a>) {
let contract_address = e.register_stellar_asset_contract(admin.clone());
let sac = e.register_stellar_asset_contract_v2(admin.clone());
(
TokenClient::new(e, &contract_address),
TokenAdminClient::new(e, &contract_address),
token::Client::new(e, &sac.address()),
token::StellarAssetClient::new(e, &sac.address()),
)
}

Expand Down

0 comments on commit 00845e8

Please sign in to comment.