Skip to content

Commit

Permalink
simple-lock/proxy-dex improvements
Browse files Browse the repository at this point in the history
simple-lock: Check Wrapped LP in destry test
proxy-dex: Remove unnecesarry function

Signed-off-by: Costin Carabaș <[email protected]>
  • Loading branch information
CostinCarabas committed Feb 6, 2024
1 parent a60edcd commit 1d02cac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
11 changes: 9 additions & 2 deletions locked-asset/proxy_dex/tests/proxy_farm_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ fn destroy_farm_locked_tokens_test() {
setup.b_mock.set_block_nonce(100);

////////////////////////////////////////////// DESTROY FARM /////////////////////////////////////

// should be 500_000_000, but ends up so due to approximations
let removed_locked_token_amount = rust_biguint!(499_999_000);
// should be 250_000_000, but ends up so due to approximations
Expand Down Expand Up @@ -1633,12 +1633,19 @@ fn destroy_farm_locked_tokens_test() {
)
.assert_ok();

// check user received half of the farm tokens back, and another new wrapped LP token
setup.b_mock.check_nft_balance::<Empty>(
&first_user,
WRAPPED_FARM_TOKEN_ID,
1,
&(&expected_lp_token_amount / 2u64),
None,
);

setup.b_mock.check_nft_balance::<Empty>(
&first_user,
WRAPPED_LP_TOKEN_ID,
1,
&rust_biguint!(0u64),
None,
);
}
22 changes: 0 additions & 22 deletions locked-asset/simple-lock/src/lp_interactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,6 @@ pub trait LpInteractionsModule {
}
}

fn call_pair_remove_liquidity_simple(
&self,
lp_address: ManagedAddress,
lp_token_id: TokenIdentifier,
lp_token_amount: BigUint,
first_token_amount_min: BigUint,
second_token_amount_min: BigUint,
) -> RemoveLiquidityResultWrapper<Self::Api> {
let lp_payments_out: RemoveLiquidityResultType<Self::Api> = self
.lp_proxy(lp_address)
.remove_liquidity(first_token_amount_min, second_token_amount_min)
.with_esdt_transfer((lp_token_id, 0, lp_token_amount))
.execute_on_dest_context();

let (first_token_payment_out, second_token_payment_out) = lp_payments_out.into_tuple();

RemoveLiquidityResultWrapper {
first_token_payment_out,
second_token_payment_out,
}
}

#[proxy]
fn lp_proxy(&self, sc_address: ManagedAddress) -> lp_proxy::Proxy<Self::Api>;
}

0 comments on commit 1d02cac

Please sign in to comment.