diff --git a/legacy-contracts/farm-staking-proxy-legacy/tests/constants/mod.rs b/legacy-contracts/farm-staking-proxy-legacy/tests/constants/mod.rs index b9eef5056..8be5d8cbd 100644 --- a/legacy-contracts/farm-staking-proxy-legacy/tests/constants/mod.rs +++ b/legacy-contracts/farm-staking-proxy-legacy/tests/constants/mod.rs @@ -1,6 +1,6 @@ // Pair constants -pub const PAIR_WASM_PATH: &'static str = "pair/output/pair.wasm"; +pub const PAIR_WASM_PATH: &str = "pair/output/pair.wasm"; pub const WEGLD_TOKEN_ID: &[u8] = b"WEGLD-abcdef"; pub const RIDE_TOKEN_ID: &[u8] = b"RIDE-abcdef"; pub const LP_TOKEN_ID: &[u8] = b"LPTOK-abcdef"; // also farming token ID for LP farm @@ -15,7 +15,7 @@ pub const BLOCK_NONCE_AFTER_PAIR_SETUP: u64 = 100; // LP farm constants -pub const FARM_WASM_PATH: &'static str = "farm/output/farm.wasm"; +pub const FARM_WASM_PATH: &str = "farm/output/farm.wasm"; pub const LP_FARM_TOKEN_ID: &[u8] = b"LPFARM-abcdef"; pub const DIVISION_SAFETY_CONSTANT: u64 = 1_000_000_000_000; pub const MIN_FARMING_EPOCHS: u8 = 2; diff --git a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp.rs b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp.rs index c7f92adf0..6e3a01f00 100644 --- a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp.rs +++ b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp.rs @@ -138,8 +138,6 @@ fn test_unstake_from_legacy_proxy() { 1, dual_yield_token_amount, expected_token_amount, - 0, - 0, expected_token_amount, 30, ); diff --git a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_external_contracts/mod.rs b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_external_contracts/mod.rs index 94306f44e..026fea631 100644 --- a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_external_contracts/mod.rs +++ b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_external_contracts/mod.rs @@ -36,12 +36,12 @@ where b_mock.create_sc_account(&rust_zero, Some(owner_addr), pair_builder, PAIR_WASM_PATH); b_mock - .execute_tx(&owner_addr, &pair_wrapper, &rust_zero, |sc| { + .execute_tx(owner_addr, &pair_wrapper, &rust_zero, |sc| { let first_token_id = managed_token_id!(WEGLD_TOKEN_ID); let second_token_id = managed_token_id!(RIDE_TOKEN_ID); - let router_address = managed_address!(&owner_addr); - let router_owner_address = managed_address!(&owner_addr); - let initial_liquidity_adder = managed_address!(&owner_addr); + let router_address = managed_address!(owner_addr); + let router_owner_address = managed_address!(owner_addr); + let initial_liquidity_adder = managed_address!(owner_addr); let total_fee_percent = 300u64; let special_fee_percent = 50u64; @@ -66,12 +66,12 @@ where // set user balance b_mock.set_esdt_balance( - &user_addr, + user_addr, WEGLD_TOKEN_ID, &rust_biguint!(USER_TOTAL_WEGLD_TOKENS), ); b_mock.set_esdt_balance( - &user_addr, + user_addr, RIDE_TOKEN_ID, &rust_biguint!(USER_TOTAL_RIDE_TOKENS), ); @@ -79,12 +79,12 @@ where b_mock.set_block_nonce(BLOCK_NONCE_FIRST_ADD_LIQ); b_mock.set_esdt_balance( - &owner_addr, + owner_addr, WEGLD_TOKEN_ID, &rust_biguint!(USER_TOTAL_WEGLD_TOKENS), ); b_mock.set_esdt_balance( - &owner_addr, + owner_addr, RIDE_TOKEN_ID, &rust_biguint!(USER_TOTAL_RIDE_TOKENS), ); @@ -102,7 +102,7 @@ where }, ]; b_mock - .execute_esdt_multi_transfer(&owner_addr, &pair_wrapper, &payments, |sc| { + .execute_esdt_multi_transfer(owner_addr, &pair_wrapper, &payments, |sc| { sc.add_initial_liquidity(); }) .assert_ok(); @@ -110,7 +110,7 @@ where b_mock.set_block_nonce(BLOCK_NONCE_SECOND_ADD_LIQ); b_mock - .execute_esdt_multi_transfer(&owner_addr, &pair_wrapper, &payments, |sc| { + .execute_esdt_multi_transfer(owner_addr, &pair_wrapper, &payments, |sc| { sc.add_liquidity(managed_biguint!(1u64), managed_biguint!(1u64)); }) .assert_ok(); @@ -131,12 +131,12 @@ where { let rust_zero = rust_biguint!(0u64); let farm_wrapper = - b_mock.create_sc_account(&rust_zero, Some(&owner_addr), farm_builder, FARM_WASM_PATH); + b_mock.create_sc_account(&rust_zero, Some(owner_addr), farm_builder, FARM_WASM_PATH); // init farm contract b_mock - .execute_tx(&owner_addr, &farm_wrapper, &rust_zero, |sc| { + .execute_tx(owner_addr, &farm_wrapper, &rust_zero, |sc| { let reward_token_id = managed_token_id!(RIDE_TOKEN_ID); let farming_token_id = managed_token_id!(LP_TOKEN_ID); let division_safety_constant = managed_biguint!(DIVISION_SAFETY_CONSTANT); diff --git a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index cc134820c..6a2406a63 100644 --- a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -18,11 +18,6 @@ use crate::{ }, }; -pub struct NonceAmountPair { - pub nonce: u64, - pub amount: u64, -} - pub struct FarmStakingSetup< PairObjBuilder, FarmObjBuilder, @@ -133,8 +128,6 @@ where dual_yield_token_nonce: u64, dual_yield_token_amount: u64, expected_wegld_amount: u64, - expected_lp_farm_rewards: u64, - expected_staking_rewards: u64, expected_unbond_token_amount: u64, expected_unbond_token_unlock_epoch: u64, ) -> u64 { @@ -160,20 +153,6 @@ where vec_index += 1; } - if expected_lp_farm_rewards > 0 { - let lp_farm_rewards = received_tokens.get(vec_index); - assert_eq!(lp_farm_rewards.amount, expected_lp_farm_rewards); - - vec_index += 1; - } - - if expected_staking_rewards > 0 { - let staking_rewards = received_tokens.get(vec_index); - assert_eq!(staking_rewards.amount, expected_staking_rewards); - - vec_index += 1; - } - let unbond_tokens = received_tokens.get(vec_index); assert_eq!(unbond_tokens.amount, expected_unbond_token_amount); diff --git a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs index 0cca69853..e4ed2862f 100644 --- a/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs +++ b/legacy-contracts/farm-staking-proxy-legacy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs @@ -120,7 +120,7 @@ where b_mock.create_sc_account(&rust_zero, Some(owner_addr), builder, PROXY_WASM_PATH); b_mock - .execute_tx(&owner_addr, &proxy_wrapper, &rust_zero, |sc| { + .execute_tx(owner_addr, &proxy_wrapper, &rust_zero, |sc| { sc.init(); sc.pair_address().set(managed_address!(pair_address));