Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberHoward committed Aug 2, 2024
1 parent 045d539 commit 236f026
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 8 deletions.
32 changes: 28 additions & 4 deletions contracts/carrot-app/tests/autocompound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,20 @@ fn check_autocompound() -> anyhow::Result<()> {
],
)?;
for _ in 0..10 {
dex.ans_swap((USDC, 50_000), USDT, DEX_NAME.to_string(), &account)?;
dex.ans_swap((USDT, 50_000), USDC, DEX_NAME.to_string(), &account)?;
dex.ans_swap(
(USDC, 50_000),
USDT,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
dex.ans_swap(
(USDT, 50_000),
USDC,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
}

// Check autocompound adds liquidity from the rewards and user balance remain unchanged
Expand Down Expand Up @@ -209,8 +221,20 @@ fn stranger_autocompound() -> anyhow::Result<()> {
],
)?;
for _ in 0..10 {
dex.ans_swap((USDC, 50_000), USDT, DEX_NAME.to_string(), &account)?;
dex.ans_swap((USDT, 50_000), USDC, DEX_NAME.to_string(), &account)?;
dex.ans_swap(
(USDC, 50_000),
USDT,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
dex.ans_swap(
(USDT, 50_000),
USDC,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
}

// Check autocompound adds liquidity from the rewards, user balance remain unchanged
Expand Down
32 changes: 28 additions & 4 deletions contracts/carrot-app/tests/deposit_withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,20 @@ fn partial_withdraw_position_autoclaims() -> anyhow::Result<()> {
],
)?;
for _ in 0..10 {
dex.ans_swap((USDC, 50_000), USDT, DEX_NAME.to_string(), &account)?;
dex.ans_swap((USDT, 50_000), USDC, DEX_NAME.to_string(), &account)?;
dex.ans_swap(
(USDC, 50_000),
USDT,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
dex.ans_swap(
(USDT, 50_000),
USDC,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
}

// Check it has some rewards
Expand Down Expand Up @@ -349,8 +361,20 @@ fn manual_partial_withdraw_position_doesnt_autoclaim() -> anyhow::Result<()> {
],
)?;
for _ in 0..10 {
dex.ans_swap((USDC, 50_000), USDT, DEX_NAME.to_string(), &account)?;
dex.ans_swap((USDT, 50_000), USDC, DEX_NAME.to_string(), &account)?;
dex.ans_swap(
(USDC, 50_000),
USDT,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
dex.ans_swap(
(USDT, 50_000),
USDC,
DEX_NAME.to_string(),
&account,
&abs.ans_host,
)?;
}

// Check it has some rewards
Expand Down

0 comments on commit 236f026

Please sign in to comment.