Skip to content

Commit 79b7d26

Browse files
committed
testing fixes
- eulerSwap instance should be activated first for approvals/enabling collateral - used to be done on first swap - Seeds poolManager with starting balance - Typo in exact output test
1 parent 0989f17 commit 79b7d26

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/EulerSwapHook.swaps.t.sol

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ contract EulerSwapHookTest is EulerSwapTestBase {
2929
swapRouter = new PoolSwapTest(poolManager);
3030

3131
eulerSwap = createEulerSwapHook(poolManager, 60e18, 60e18, 0, 1e18, 1e18, 0.4e18, 0.85e18);
32+
eulerSwap.activate();
3233

3334
// confirm pool was created
3435
assertFalse(eulerSwap.poolKey().currency1 == CurrencyLibrary.ADDRESS_ZERO);
3536
(uint160 sqrtPriceX96,,,) = poolManager.getSlot0(eulerSwap.poolKey().toId());
3637
assertNotEq(sqrtPriceX96, 0);
38+
39+
// Seed the poolManager with balance so that transient withdrawing before depositing succeeds
40+
assetTST.mint(address(poolManager), 1000e18);
41+
assetTST2.mint(address(poolManager), 1000e18);
3742
}
3843

3944
function test_SwapExactIn() public {
@@ -62,7 +67,7 @@ contract EulerSwapHookTest is EulerSwapTestBase {
6267
assetTST.mint(anyone, amountIn);
6368

6469
vm.startPrank(anyone);
65-
assetTST.approve(address(periphery), amountIn);
70+
assetTST.approve(address(swapRouter), amountIn);
6671
bool zeroForOne = address(assetTST) < address(assetTST2);
6772
_swap(eulerSwap.poolKey(), zeroForOne, false, amountOut);
6873
vm.stopPrank();

0 commit comments

Comments
 (0)