Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
hensha256 committed Aug 2, 2024
1 parent 6ba1c99 commit 2130e5c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
8 changes: 6 additions & 2 deletions test/position-managers/Execute.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ contract ExecuteTest is Test, PosmTestSetup, LiquidityFuzzers {

planner.add(
Actions.MINT_POSITION,
abi.encode(config, initialLiquidity, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, initialLiquidity, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
planner.add(
Actions.INCREASE_LIQUIDITY,
Expand Down Expand Up @@ -172,7 +174,9 @@ contract ExecuteTest is Test, PosmTestSetup, LiquidityFuzzers {
);
planner.add(
Actions.MINT_POSITION,
abi.encode(newConfig, newLiquidity, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
newConfig, newLiquidity, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
bytes memory calls = planner.finalizeModifyLiquidity(config.poolKey);

Expand Down
4 changes: 3 additions & 1 deletion test/position-managers/NativeToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ contract PositionManagerTest is Test, PosmTestSetup, LiquidityFuzzers {
Plan memory planner = Planner.init();
planner.add(
Actions.MINT_POSITION,
abi.encode(config, liquidityToAdd, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, liquidityToAdd, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
planner.add(Actions.CLOSE_CURRENCY, abi.encode(nativeKey.currency0));
planner.add(Actions.CLOSE_CURRENCY, abi.encode(nativeKey.currency1));
Expand Down
27 changes: 21 additions & 6 deletions test/position-managers/PositionManager.gas.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot {
function test_gas_mint() public {
Plan memory planner = Planner.init().add(
Actions.MINT_POSITION,
abi.encode(config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
bytes memory calls = planner.finalizeModifyLiquidity(config.poolKey);
lpm.modifyLiquidities(calls, _deadline);
Expand All @@ -89,7 +91,9 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot {
// Mint to a diff config, diff user.
Plan memory planner = Planner.init().add(
Actions.MINT_POSITION,
abi.encode(config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
bytes memory calls = planner.finalizeModifyLiquidity(config.poolKey);
vm.prank(alice);
Expand All @@ -106,7 +110,9 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot {
// Mint to a diff config, diff user.
Plan memory planner = Planner.init().add(
Actions.MINT_POSITION,
abi.encode(config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
bytes memory calls = planner.finalizeModifyLiquidity(config.poolKey);
vm.prank(alice);
Expand All @@ -123,7 +129,9 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot {
// Mint to a diff config, diff user.
Plan memory planner = Planner.init().add(
Actions.MINT_POSITION,
abi.encode(config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, 10_000 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
bytes memory calls = planner.finalizeModifyLiquidity(config.poolKey);
vm.prank(alice);
Expand Down Expand Up @@ -350,7 +358,9 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot {

Plan memory planner = Planner.init().add(
Actions.MINT_POSITION,
abi.encode(config, 10_001 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES)
abi.encode(
config, 10_001 ether, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
)
);
bytes memory calls = planner.finalizeModifyLiquidity(config.poolKey);
vm.prank(alice);
Expand Down Expand Up @@ -473,7 +483,12 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot {
planner.add(
Actions.MINT_POSITION,
abi.encode(
configNative, liquidityToAdd, MAX_SLIPPAGE_INCREASE, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES
configNative,
liquidityToAdd,
MAX_SLIPPAGE_INCREASE,
MAX_SLIPPAGE_INCREASE,
Constants.MSG_SENDER,
ZERO_BYTES
)
);
planner.add(Actions.CLOSE_CURRENCY, abi.encode(nativeKey.currency0));
Expand Down
6 changes: 4 additions & 2 deletions test/position-managers/PositionManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,17 @@ contract PositionManagerTest is Test, PosmTestSetup, LiquidityFuzzers {
function test_mint_slippage_revertAmount0() public {
PositionConfig memory config = PositionConfig({poolKey: key, tickLower: -120, tickUpper: 120});

bytes memory calls = getMintEncoded(config, 1e18, 1 wei, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES);
bytes memory calls =
getMintEncoded(config, 1e18, 1 wei, MAX_SLIPPAGE_INCREASE, Constants.MSG_SENDER, ZERO_BYTES);
vm.expectRevert(SlippageCheckLibrary.MaximumAmountExceeded.selector);
lpm.modifyLiquidities(calls, _deadline);
}

function test_mint_slippage_revertAmount1() public {
PositionConfig memory config = PositionConfig({poolKey: key, tickLower: -120, tickUpper: 120});

bytes memory calls = getMintEncoded(config, 1e18, MAX_SLIPPAGE_INCREASE, 1 wei, Constants.MSG_SENDER, ZERO_BYTES);
bytes memory calls =
getMintEncoded(config, 1e18, MAX_SLIPPAGE_INCREASE, 1 wei, Constants.MSG_SENDER, ZERO_BYTES);
vm.expectRevert(SlippageCheckLibrary.MaximumAmountExceeded.selector);
lpm.modifyLiquidities(calls, _deadline);
}
Expand Down

0 comments on commit 2130e5c

Please sign in to comment.