From 5cc4cf47d269b2b159c094e9e04fb1f787151ab4 Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Mon, 2 Sep 2024 20:22:13 +0200 Subject: [PATCH] test: Add test case for no excess left --- test/paraswap/paraswapAdapters.repay.edge.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/paraswap/paraswapAdapters.repay.edge.spec.ts b/test/paraswap/paraswapAdapters.repay.edge.spec.ts index b273310..99bfea8 100644 --- a/test/paraswap/paraswapAdapters.repay.edge.spec.ts +++ b/test/paraswap/paraswapAdapters.repay.edge.spec.ts @@ -157,6 +157,7 @@ makeSuite('Paraswap adapters', (testEnv: TestEnv) => { '0x0000000000000000000000000000000000000000000000000000000000000000' ); + console.log(); await expect( pool .connect(user) @@ -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);