Skip to content

Commit

Permalink
fix: cast in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-something committed Apr 11, 2024
1 parent 9ca359c commit 62fa7c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/exhausted-pigeon/uniswap-v3-foundry-pool"
},
"version": "1.0.3",
"version": "1.0.4",
"license": "MIT",
"devDependencies": {
"@exhausted-pigeon/uniswap-v3-forge-quoter": "^1.0.1"
Expand Down
20 changes: 10 additions & 10 deletions test/PoolTestHelper.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ contract PoolTestHelper_Test is Test, Events {
function test_deployNewPool() public {
uint256 _snap = vm.snapshot();

IUniswapV3Pool _pool = helper.createPool(
IUniswapV3Pool _pool = IUniswapV3Pool(helper.createPool(
tokenA,
tokenB,
100,
TickMath.MIN_SQRT_RATIO + 1,
PoolTestHelper.Chains.Mainnet
);
));

(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);

Expand All @@ -57,13 +57,13 @@ contract PoolTestHelper_Test is Test, Events {

vm.revertTo(_snap);

IUniswapV3Pool _pool2 = helper.createPool(
IUniswapV3Pool _pool2 = IUniswapV3Pool(helper.createPool(
tokenA,
tokenB,
100,
TickMath.MIN_SQRT_RATIO + 1,
PoolTestHelper.Chains.Mainnet
);
));

(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);

Expand All @@ -74,13 +74,13 @@ contract PoolTestHelper_Test is Test, Events {
}

function test_addLiquidity_fullRange() public returns(uint256 _liquidityAmount){
pool = helper.createPool(
pool = IUniswapV3Pool(helper.createPool(
tokenA,
tokenB,
100,
1 ether,
PoolTestHelper.Chains.Mainnet
);
));

// Not matching the data (here, amount)
vm.expectEmit(true, true, true, false, address(tokenA));
Expand Down Expand Up @@ -110,21 +110,21 @@ contract PoolTestHelper_Test is Test, Events {
1e18
);

return helper.addLiquidityFullRange(pool, 10e18, 10e18);
return helper.addLiquidityFullRange(address(pool), 10e18, 10e18);
}

function test_addLiquidity_concentrated() public {
// Fee 500 -> tick spacing 10
int24 _lowerTick = 1000;
int24 _upperTick = _lowerTick + 10;

pool = helper.createPool(
pool = IUniswapV3Pool(helper.createPool(
tokenA,
tokenB,
500,
TickMath.getSqrtRatioAtTick(_lowerTick + 5),
PoolTestHelper.Chains.Mainnet
);
));

// Not matching the data (here, amount)
vm.expectEmit(true, true, false, false, address(tokenA));
Expand Down Expand Up @@ -154,7 +154,7 @@ contract PoolTestHelper_Test is Test, Events {
1e18
);

helper.addLiquidity(pool, _lowerTick, _upperTick, 1e18, 1e18);
helper.addLiquidity(address(pool), _lowerTick, _upperTick, 1e18, 1e18);
}

// swap
Expand Down

0 comments on commit 62fa7c4

Please sign in to comment.