Skip to content

Commit

Permalink
test: Add test case for no excess left
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Sep 2, 2024
1 parent 9b232f7 commit 5cc4cf4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/paraswap/paraswapAdapters.repay.edge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ makeSuite('Paraswap adapters', (testEnv: TestEnv) => {
'0x0000000000000000000000000000000000000000000000000000000000000000'
);

console.log();
await expect(
pool
.connect(user)
Expand All @@ -174,6 +175,13 @@ makeSuite('Paraswap adapters', (testEnv: TestEnv) => {
dai.address,
amountWETHtoSwap.sub(EXCESS_FROM_AMOUNT).toString(),
expectedDaiAmount.add(EXCESS_TO_AMOUNT)
)
.to.emit(pool, 'Withdraw')
.withArgs(
weth.address,
paraswapRepayAdapter.address,
paraswapRepayAdapter.address,
flashloanTotal.sub(EXCESS_FROM_AMOUNT)
);

const adapterWethBalance = await weth.balanceOf(paraswapRepayAdapter.address);
Expand Down

0 comments on commit 5cc4cf4

Please sign in to comment.