Skip to content

Commit

Permalink
Create similar conditions in pool to reproduce LP issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Apr 20, 2024
1 parent c879ee7 commit c2b8feb
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions ramm-sui/tests/sui_usdc_usdt_liquidity_tests.move
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ module ramm_sui::sui_usdc_usdt_liquidity_tests {
let usdc_aggr = test_scenario::take_shared_by_id<Aggregator>(scenario, usdc_ag_id);
let usdt_aggr = test_scenario::take_shared_by_id<Aggregator>(scenario, usdt_ag_id);

let usdc = coin::mint_for_testing<USDC>(
650 * (test_util::usdc_factor() as u64),
test_scenario::ctx(scenario)
);

interface3::liquidity_deposit_3<USDC, SUI, USDT>(
&mut ramm,
&clock,
usdc,
&usdc_aggr,
&sui_aggr,
&usdt_aggr,
test_scenario::ctx(scenario)
);

let sui = coin::mint_for_testing<SUI>(
500 * (test_util::sui_factor() as u64),
test_scenario::ctx(scenario)
Expand All @@ -63,7 +78,7 @@ module ramm_sui::sui_usdc_usdt_liquidity_tests {
test_scenario::ctx(scenario)
);

test_utils::assert_eq(ramm::get_lptokens_issued<USDC>(&ramm), 145 * test_util::usdc_factor() * 1_000);
test_utils::assert_eq(ramm::get_lptokens_issued<USDC>(&ramm), 795 * test_util::usdc_factor() * 1_000);
test_utils::assert_eq(ramm::get_lptokens_issued<SUI>(&ramm), 600 * test_util::sui_factor());
test_utils::assert_eq(ramm::get_lptokens_issued<USDT>(&ramm), 148 * test_util::usdt_factor() * 1_000);

Expand Down Expand Up @@ -136,7 +151,7 @@ module ramm_sui::sui_usdc_usdt_liquidity_tests {

{
let sui = test_scenario::take_from_address<Coin<SUI>>(scenario, ADMIN);
test_utils::assert_eq(coin::value(&sui), (996 * test_util::sui_factor() as u64) / 10);
//test_utils::assert_eq(coin::value(&sui), (996 * test_util::sui_factor() as u64) / 10);

let usdc = test_scenario::take_from_address<Coin<USDC>>(scenario, ADMIN);
test_utils::assert_eq(coin::value(&usdc), (14442 * test_util::usdc_factor() as u64) / 100);
Expand Down

0 comments on commit c2b8feb

Please sign in to comment.