From bafeb565b03ed6714b8c58aae066648e835c5848 Mon Sep 17 00:00:00 2001 From: prosperring Date: Sun, 14 Jul 2024 23:12:51 +0300 Subject: [PATCH] tests: Use updated test names test_{function}_{case} Resolves Issue: Uniswap#390 --- test/CustomAccounting.t.sol | 4 +-- test/DynamicFees.t.sol | 2 +- test/DynamicReturnFees.t.sol | 2 +- test/Extsload.t.sol | 4 +-- test/ModifyLiquidity.t.sol | 6 ++-- test/NoDelegateCall.t.sol | 2 +- test/PoolManagerInitialize.t.sol | 2 +- test/ProtocolFeesImplementation.t.sol | 6 ++-- test/SkipCallsTestHook.t.sol | 2 +- test/libraries/BitMath.t.sol | 4 +-- test/libraries/FullMath.t.sol | 8 ++--- test/libraries/Hooks.t.sol | 42 ++++++++++++------------- test/libraries/LPFeeLibrary.t.sol | 6 ++-- test/libraries/NonZeroDeltaCount.t.sol | 2 +- test/libraries/Pool.t.sol | 4 +-- test/libraries/PoolId.t.sol | 2 +- test/libraries/Position.t.sol | 4 +-- test/libraries/ProtocolFeeLibrary.t.sol | 8 ++--- test/libraries/SafeCast.t.sol | 10 +++--- test/libraries/StateLibrary.t.sol | 14 ++++----- test/libraries/SwapMath.t.sol | 4 +-- test/libraries/TickBitmap.t.sol | 10 +++--- test/libraries/TickMath.t.sol | 4 +-- test/libraries/UnsafeMath.t.sol | 2 +- test/types/BalanceDelta.t.sol | 12 +++---- test/types/Currency.t.sol | 30 +++++++++--------- test/types/Slot0.t.sol | 2 +- 27 files changed, 99 insertions(+), 99 deletions(-) diff --git a/test/CustomAccounting.t.sol b/test/CustomAccounting.t.sol index 9e35d344f..9ce42b73f 100644 --- a/test/CustomAccounting.t.sol +++ b/test/CustomAccounting.t.sol @@ -152,11 +152,11 @@ contract CustomAccountingTest is Test, Deployers, GasSnapshot { assertEq(currency1.balanceOf(address(this)), balanceBefore1 + amountToSwap, "amount 1"); } - // maximum available liquidity in each direction for the pool in test_fuzz_swap_beforeSwap_returnsDeltaSpecified + // maximum available liquidity in each direction for the pool in test_swap_beforeSwap_returnsDeltaSpecified_fuzz int128 maxPossibleIn_fuzz_test = -6018336102428409; int128 maxPossibleOut_fuzz_test = 5981737760509662; - function test_fuzz_swap_beforeSwap_returnsDeltaSpecified( + function test_swap_beforeSwap_returnsDeltaSpecified_fuzz( int128 hookDeltaSpecified, int256 amountSpecified, bool zeroForOne diff --git a/test/DynamicFees.t.sol b/test/DynamicFees.t.sol index 63cde8f9e..5d9371611 100644 --- a/test/DynamicFees.t.sol +++ b/test/DynamicFees.t.sol @@ -282,7 +282,7 @@ contract TestDynamicFees is Test, Deployers, GasSnapshot { assertEq(_fetchPoolLPFee(key), 123); } - function test_fuzz_ProtocolAndLPFee(uint24 lpFee, uint16 protocolFee0, uint16 protocolFee1, int256 amountSpecified) + function test_ProtocolAndLPFee_fuzz(uint24 lpFee, uint16 protocolFee0, uint16 protocolFee1, int256 amountSpecified) public { assertEq(_fetchPoolLPFee(key), 0); diff --git a/test/DynamicReturnFees.t.sol b/test/DynamicReturnFees.t.sol index c677e4610..353f59a61 100644 --- a/test/DynamicReturnFees.t.sol +++ b/test/DynamicReturnFees.t.sol @@ -59,7 +59,7 @@ contract TestDynamicReturnFees is Test, Deployers, GasSnapshot { ); } - function test_fuzz_dynamicReturnSwapFee(uint24 fee) public { + function test_dynamicReturnSwapFee_fuzz(uint24 fee) public { // hook will handle adding the override flag dynamicReturnFeesHook.setFee(fee); diff --git a/test/Extsload.t.sol b/test/Extsload.t.sol index f16964cdc..6c7829bb7 100644 --- a/test/Extsload.t.sol +++ b/test/Extsload.t.sol @@ -26,7 +26,7 @@ contract ExtsloadTest is Test, GasSnapshot { } } - function test_fuzz_consecutiveExtsload(uint256 startSlot, uint256 length, uint256 seed) public { + function test_consecutiveExtsload_fuzz(uint256 startSlot, uint256 length, uint256 seed) public { length = bound(length, 0, 1000); startSlot = bound(startSlot, 0, type(uint256).max - length); for (uint256 i; i < length; ++i) { @@ -39,7 +39,7 @@ contract ExtsloadTest is Test, GasSnapshot { } } - function test_fuzz_extsload(uint256 length, uint256 seed, bytes memory dirtyBits) public { + function test_extsload_fuzz(uint256 length, uint256 seed, bytes memory dirtyBits) public { length = bound(length, 0, 1000); bytes32[] memory slots = new bytes32[](length); bytes32[] memory expected = new bytes32[](length); diff --git a/test/ModifyLiquidity.t.sol b/test/ModifyLiquidity.t.sol index 38542c3de..3beb06764 100644 --- a/test/ModifyLiquidity.t.sol +++ b/test/ModifyLiquidity.t.sol @@ -50,7 +50,7 @@ contract ModifyLiquidityTest is Test, Logger, Deployers, JavascriptFfi, Fuzzers, /// forge-config: default.fuzz.runs = 10 /// forge-config: pr.fuzz.runs = 10 /// forge-config: ci.fuzz.runs = 500 - function test_ffi_fuzz_addLiquidity_defaultPool_ReturnsCorrectLiquidityDelta( + function test_ffi_addLiquidity_defaultPool_ReturnsCorrectLiquidityDelta_fuzz( IPoolManager.ModifyLiquidityParams memory paramSeed ) public { // Sanitize the fuzzed params to get valid tickLower, tickUpper, and liquidityDelta. @@ -304,12 +304,12 @@ contract ModifyLiquidityTest is Test, Logger, Deployers, JavascriptFfi, Fuzzers, assertEq(updatedPositionSalt.liquidity, uint128(uint256(LIQ_PARAM_SALT.liquidityDelta))); } - function test_gas_modifyLiquidity_newPosition() public { + function test_modifyLiquidity_newPosition_gas() public { modifyLiquidityRouter.modifyLiquidity(simpleKey, LIQ_PARAM_SALT, ZERO_BYTES); snapLastCall("create new liquidity to a position with salt"); } - function test_gas_modifyLiquidity_updateSamePosition_withSalt() public { + function test_modifyLiquidity_updateSamePosition_withSalt_gas() public { modifyLiquidityRouter.modifyLiquidity(simpleKey, LIQ_PARAM_SALT, ZERO_BYTES); modifyLiquidityRouter.modifyLiquidity(simpleKey, LIQ_PARAM_SALT, ZERO_BYTES); snapLastCall("add liquidity to already existing position with salt"); diff --git a/test/NoDelegateCall.t.sol b/test/NoDelegateCall.t.sol index 61173ecb6..1d40693a7 100644 --- a/test/NoDelegateCall.t.sol +++ b/test/NoDelegateCall.t.sol @@ -26,7 +26,7 @@ contract TestDelegateCall is Test, Deployers, GasSnapshot { noDelegateCallTest = new NoDelegateCallTest(); } - function test_gas_noDelegateCall() public { + function test_noDelegateCall_gas() public { snap( "NoDelegateCall", noDelegateCallTest.getGasCostOfCannotBeDelegateCalled() diff --git a/test/PoolManagerInitialize.t.sol b/test/PoolManagerInitialize.t.sol index 59563105f..22ef61121 100644 --- a/test/PoolManagerInitialize.t.sol +++ b/test/PoolManagerInitialize.t.sol @@ -53,7 +53,7 @@ contract PoolManagerInitializeTest is Test, Deployers, GasSnapshot { }); } - function test_fuzz_initialize(PoolKey memory key0, uint160 sqrtPriceX96) public { + function test_initialize_fuzz(PoolKey memory key0, uint160 sqrtPriceX96) public { // Assumptions tested in Pool.t.sol sqrtPriceX96 = uint160(bound(sqrtPriceX96, TickMath.MIN_SQRT_PRICE, TickMath.MAX_SQRT_PRICE - 1)); diff --git a/test/ProtocolFeesImplementation.t.sol b/test/ProtocolFeesImplementation.t.sol index c4508953b..7d4b1a480 100644 --- a/test/ProtocolFeesImplementation.t.sol +++ b/test/ProtocolFeesImplementation.t.sol @@ -89,7 +89,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { protocolFees.setProtocolFee(key, protocolFee); } - function test_fuzz_setProtocolFee(PoolKey memory key, uint24 protocolFee) public { + function test_setProtocolFee_fuzz(PoolKey memory key, uint24 protocolFee) public { protocolFees.setProtocolFeeController(feeController); // Set price to pretend that the pool is initialized protocolFees.setPrice(key, Constants.SQRT_PRICE_1_1); @@ -123,7 +123,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { assertEq(currency0.balanceOf(address(this)), 100); } - function test_fuzz_collectProtocolFees(address recipient, uint256 amount, uint256 feesAccrued) public { + function test_collectProtocolFees_fuzz(address recipient, uint256 amount, uint256 feesAccrued) public { vm.assume(feesAccrued <= currency0.balanceOf(address(protocolFees))); uint256 recipientBalanceBefore = currency0.balanceOf(recipient); @@ -164,7 +164,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { assertEq(protocolFees.protocolFeesAccrued(currency0), 300); } - function test_fuzz_updateProtocolFees(uint256 amount, uint256 startingAmount) public { + function test_updateProtocolFees_fuzz(uint256 amount, uint256 startingAmount) public { // set a starting balance of protocol fees protocolFees.updateProtocolFees(currency0, startingAmount); assertEq(protocolFees.protocolFeesAccrued(currency0), startingAmount); diff --git a/test/SkipCallsTestHook.t.sol b/test/SkipCallsTestHook.t.sol index 18c1b8e64..612fdb18b 100644 --- a/test/SkipCallsTestHook.t.sol +++ b/test/SkipCallsTestHook.t.sol @@ -148,7 +148,7 @@ contract SkipCallsTest is Test, Deployers, GasSnapshot { assertEq(skipCallsTestHook.counter(), 2); } - function test_gas_beforeSwap_skipIfCalledByHook() public { + function test_beforeSwap_skipIfCalledByHook_gas() public { SkipCallsTestHook skipCallsTestHook = SkipCallsTestHook( address(uint160(type(uint160).max & clearAllHookPermissionsMask | Hooks.BEFORE_SWAP_FLAG)) ); diff --git a/test/libraries/BitMath.t.sol b/test/libraries/BitMath.t.sol index dcc0295a0..cb36f09bc 100644 --- a/test/libraries/BitMath.t.sol +++ b/test/libraries/BitMath.t.sol @@ -30,7 +30,7 @@ contract TestBitMath is Test, GasSnapshot { assertEq(BitMath.mostSignificantBit(type(uint256).max), 255); } - function test_fuzz_mostSignificantBit(uint256 x) public pure { + function test_mostSignificantBit_fuzz(uint256 x) public pure { vm.assume(x != 0); assertEq(BitMath.mostSignificantBit(x), mostSignificantBitReference(x)); } @@ -80,7 +80,7 @@ contract TestBitMath is Test, GasSnapshot { assertEq(BitMath.leastSignificantBit(type(uint256).max), 0); } - function test_fuzz_leastSignificantBit(uint256 x) public pure { + function test_leastSignificantBit_fuzz(uint256 x) public pure { vm.assume(x != 0); assertEq(BitMath.leastSignificantBit(x), leastSignificantBitReference(x)); } diff --git a/test/libraries/FullMath.t.sol b/test/libraries/FullMath.t.sol index 5978e351b..026519d19 100644 --- a/test/libraries/FullMath.t.sol +++ b/test/libraries/FullMath.t.sol @@ -10,7 +10,7 @@ contract FullMathTest is Test { uint256 constant Q128 = 2 ** 128; uint256 constant MAX_UINT256 = type(uint256).max; - function test_fuzz_mulDiv_revertsWith0Denominator(uint256 x, uint256 y) public { + function test_mulDiv_revertsWith0Denominator_fuzz(uint256 x, uint256 y) public { vm.expectRevert(); x.mulDiv(y, 0); } @@ -49,14 +49,14 @@ contract FullMathTest is Test { assertEq(Q128.mulDiv(1000 * Q128, 3000 * Q128), result); } - function test_fuzz_mulDiv(uint256 x, uint256 y, uint256 d) public pure { + function test_mulDiv_fuzz(uint256 x, uint256 y, uint256 d) public pure { vm.assume(d != 0); vm.assume(y != 0); x = bound(x, 0, type(uint256).max / y); assertEq(FullMath.mulDiv(x, y, d), x * y / d); } - function test_fuzz_mulDivRoundingUp_revertsWith0Denominator(uint256 x, uint256 y) public { + function test_mulDivRoundingUp_revertsWith0Denominator_fuzz(uint256 x, uint256 y) public { vm.expectRevert(); x.mulDivRoundingUp(y, 0); } @@ -94,7 +94,7 @@ contract FullMathTest is Test { ); } - function test_fuzz_mulDivRoundingUp(uint256 x, uint256 y, uint256 d) public pure { + function test_mulDivRoundingUp_fuzz(uint256 x, uint256 y, uint256 d) public pure { vm.assume(d != 0); vm.assume(y != 0); x = bound(x, 0, type(uint256).max / y); diff --git a/test/libraries/Hooks.t.sol b/test/libraries/Hooks.t.sol index 10f6db7bc..6f550250d 100644 --- a/test/libraries/Hooks.t.sol +++ b/test/libraries/Hooks.t.sol @@ -194,7 +194,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { } // hook validation - function test_fuzz_validateHookPermissions_noHooks(uint160 addr) public view { + function test_validateHookPermissions_noHooks_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(preAddr)); @@ -233,7 +233,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeInitialize(uint160 addr) public view { + function test_validateHookPermissions_beforeInitialize_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_INITIALIZE_FLAG))); @@ -272,7 +272,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_afterInitialize(uint160 addr) public view { + function test_validateHookPermissions_afterInitialize_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.AFTER_INITIALIZE_FLAG))); @@ -311,7 +311,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeAndAfterInitialize(uint160 addr) public view { + function test_validateHookPermissions_beforeAndAfterInitialize_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_INITIALIZE_FLAG | Hooks.AFTER_INITIALIZE_FLAG))); Hooks.validateHookPermissions( @@ -349,7 +349,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeAddLiquidity(uint160 addr) public view { + function test_validateHookPermissions_beforeAddLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_ADD_LIQUIDITY_FLAG))); Hooks.validateHookPermissions( @@ -387,7 +387,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_afterAddLiquidity(uint160 addr) public view { + function test_validateHookPermissions_afterAddLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.AFTER_ADD_LIQUIDITY_FLAG))); Hooks.validateHookPermissions( @@ -425,7 +425,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeAndAfterAddLiquidity(uint160 addr) public view { + function test_validateHookPermissions_beforeAndAfterAddLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_ADD_LIQUIDITY_FLAG | Hooks.AFTER_ADD_LIQUIDITY_FLAG))); @@ -464,7 +464,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeRemoveLiquidity(uint160 addr) public view { + function test_validateHookPermissions_beforeRemoveLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_REMOVE_LIQUIDITY_FLAG))); Hooks.validateHookPermissions( @@ -502,7 +502,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_afterRemoveLiquidity(uint160 addr) public view { + function test_validateHookPermissions_afterRemoveLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.AFTER_REMOVE_LIQUIDITY_FLAG))); Hooks.validateHookPermissions( @@ -540,7 +540,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeAfterRemoveLiquidity(uint160 addr) public view { + function test_validateHookPermissions_beforeAfterRemoveLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_REMOVE_LIQUIDITY_FLAG | Hooks.AFTER_REMOVE_LIQUIDITY_FLAG))); @@ -579,7 +579,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeInitializeAfterAddLiquidity(uint160 addr) public view { + function test_validateHookPermissions_beforeInitializeAfterAddLiquidity_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_INITIALIZE_FLAG | Hooks.AFTER_ADD_LIQUIDITY_FLAG))); @@ -618,7 +618,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeSwap(uint160 addr) public view { + function test_validateHookPermissions_beforeSwap_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_SWAP_FLAG))); Hooks.validateHookPermissions( @@ -656,7 +656,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_afterSwap(uint160 addr) public view { + function test_validateHookPermissions_afterSwap_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.AFTER_SWAP_FLAG))); Hooks.validateHookPermissions( @@ -694,7 +694,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeAndAfterSwap(uint160 addr) public view { + function test_validateHookPermissions_beforeAndAfterSwap_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_SWAP_FLAG | Hooks.AFTER_SWAP_FLAG))); Hooks.validateHookPermissions( @@ -732,7 +732,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeDonate(uint160 addr) public view { + function test_validateHookPermissions_beforeDonate_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_DONATE_FLAG))); Hooks.validateHookPermissions( @@ -770,7 +770,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_afterDonate(uint160 addr) public view { + function test_validateHookPermissions_afterDonate_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.AFTER_DONATE_FLAG))); Hooks.validateHookPermissions( @@ -808,7 +808,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_beforeAndAfterDonate(uint160 addr) public view { + function test_validateHookPermissions_beforeAndAfterDonate_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_DONATE_FLAG | Hooks.AFTER_DONATE_FLAG))); Hooks.validateHookPermissions( @@ -846,7 +846,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookPermissions_allHooks(uint160 addr) public view { + function test_validateHookPermissions_allHooks_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; uint160 allHookBitsFlipped = uint160((1 << hookPermissionCount) - 1); IHooks hookAddr = IHooks(address(uint160(preAddr) | allHookBitsFlipped)); @@ -885,7 +885,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertTrue(hookAddr.hasPermission(Hooks.AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)); } - function test_fuzz_validateHookAddress_failsAllHooks(uint160 addr, uint16 mask) public { + function test_validateHookAddress_failsAllHooks_fuzz(uint160 addr, uint16 mask) public { uint160 preAddr = addr & clearAllHookPermissionsMask; // Set the upper `hooksPermissionCount` number of bits to get the full mask in uint16. uint16 allHooksMask = uint16(~uint16(0)); @@ -914,7 +914,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { ); } - function test_fuzz_validateHookAddress_failsNoHooks(uint160 addr, uint16 mask) public { + function test_validateHookAddress_failsNoHooks_fuzz(uint160 addr, uint16 mask) public { // we only want hookPermissionCount of mask mask = mask >> (16 - hookPermissionCount); uint160 preAddr = addr & clearAllHookPermissionsMask; @@ -965,7 +965,7 @@ contract HooksTest is Test, Deployers, GasSnapshot { assertFalse(Hooks.isValidHookAddress(IHooks(address(0)), LPFeeLibrary.DYNAMIC_FEE_FLAG)); } - function test_fuzz_isValidHookAddress_invalid_returnsDeltaWithoutHookFlag(uint160 addr) public view { + function test_isValidHookAddress_invalid_returnsDeltaWithoutHookFlag_fuzz(uint160 addr) public view { uint160 preAddr = addr & clearAllHookPermissionsMask; IHooks hookAddr = IHooks(address(uint160(preAddr | Hooks.BEFORE_SWAP_RETURNS_DELTA_FLAG))); assertFalse(Hooks.isValidHookAddress(hookAddr, 3000)); diff --git a/test/libraries/LPFeeLibrary.t.sol b/test/libraries/LPFeeLibrary.t.sol index d492877ea..be18006a0 100644 --- a/test/libraries/LPFeeLibrary.t.sol +++ b/test/libraries/LPFeeLibrary.t.sol @@ -21,7 +21,7 @@ contract LPFeeLibraryTest is Test { assertFalse(LPFeeLibrary.isDynamicFee(dynamicFee)); } - function test_fuzz_isDynamicFee(uint24 fee) public pure { + function test_isDynamicFee_fuzz(uint24 fee) public pure { assertEq(fee == LPFeeLibrary.DYNAMIC_FEE_FLAG, LPFeeLibrary.isDynamicFee(fee)); } @@ -46,7 +46,7 @@ contract LPFeeLibraryTest is Test { LPFeeLibrary.validate(fee); } - function test_fuzz_validate(uint24 fee) public { + function test_validate_fuzz(uint24 fee) public { if (fee > 1000000) { vm.expectRevert(abi.encodeWithSelector(LPFeeLibrary.LPFeeTooLarge.selector, fee)); } @@ -75,7 +75,7 @@ contract LPFeeLibraryTest is Test { LPFeeLibrary.getInitialLPFee(dynamicFee); } - function test_fuzz_getInitialLPFee(uint24 fee) public { + function test_getInitialLPFee_fuzz(uint24 fee) public { if (fee == LPFeeLibrary.DYNAMIC_FEE_FLAG) { assertEq(LPFeeLibrary.getInitialLPFee(fee), 0); } else if (fee > 1000000) { diff --git a/test/libraries/NonZeroDeltaCount.t.sol b/test/libraries/NonZeroDeltaCount.t.sol index 6451b60fc..8e46786fa 100644 --- a/test/libraries/NonZeroDeltaCount.t.sol +++ b/test/libraries/NonZeroDeltaCount.t.sol @@ -21,7 +21,7 @@ contract NonZeroDeltaCountTest is Test { // Reading from right to left. Bit of 0: call increase. Bit of 1: call decrease. // The library allows over over/underflow so we dont check for that here - function test_fuzz_nonZeroDeltaCount(uint256 instructions) public { + function test_nonZeroDeltaCount_fuzz(uint256 instructions) public { assertEq(NonZeroDeltaCount.read(), 0); uint256 expectedCount; for (uint256 i = 0; i < 256; i++) { diff --git a/test/libraries/Pool.t.sol b/test/libraries/Pool.t.sol index 17059c289..64ffbe448 100644 --- a/test/libraries/Pool.t.sol +++ b/test/libraries/Pool.t.sol @@ -91,7 +91,7 @@ contract PoolTest is Test, GasSnapshot { state.modifyLiquidity(params); } - function test_fuzz_swap( + function test_swap_fuzz( uint160 sqrtPriceX96, uint24 lpFee, uint16 protocolFee0, @@ -168,7 +168,7 @@ contract PoolTest is Test, GasSnapshot { } } - function test_fuzz_tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) public pure { + function test_tickSpacingToMaxLiquidityPerTick_fuzz(int24 tickSpacing) public pure { tickSpacing = int24(bound(tickSpacing, TickMath.MIN_TICK_SPACING, TickMath.MAX_TICK_SPACING)); // v3 math int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing; diff --git a/test/libraries/PoolId.t.sol b/test/libraries/PoolId.t.sol index 24dfbee4b..b201d7185 100644 --- a/test/libraries/PoolId.t.sol +++ b/test/libraries/PoolId.t.sol @@ -8,7 +8,7 @@ import {PoolKey} from "../../src/types/PoolKey.sol"; contract PoolIdTest is Test { using PoolIdLibrary for PoolKey; - function test_fuzz_toId(PoolKey memory poolKey) public pure { + function test_toId_fuzz(PoolKey memory poolKey) public pure { bytes memory encodedKey = abi.encode(poolKey); bytes32 expectedHash = keccak256(encodedKey); assertEq(PoolId.unwrap(poolKey.toId()), expectedHash, "hashes not equal"); diff --git a/test/libraries/Position.t.sol b/test/libraries/Position.t.sol index cd64893d5..1640b605b 100644 --- a/test/libraries/Position.t.sol +++ b/test/libraries/Position.t.sol @@ -10,7 +10,7 @@ contract PositionTest is Test { mapping(bytes32 => Position.Info) internal positions; - function test_fuzz_get(address owner, int24 tickLower, int24 tickUpper, bytes32 salt) public view { + function test_get_fuzz(address owner, int24 tickLower, int24 tickUpper, bytes32 salt) public view { bytes32 positionKey = keccak256(abi.encodePacked(owner, tickLower, tickUpper, salt)); Position.Info storage expectedPosition = positions[positionKey]; Position.Info storage position = positions.get(owner, tickLower, tickUpper, salt); @@ -23,7 +23,7 @@ contract PositionTest is Test { assertEq(positionSlot, expectedPositionSlot, "slots not equal"); } - function test_fuzz_update( + function test_update_fuzz( int128 liquidityDelta, Position.Info memory pos, uint256 newFeeGrowthInside0X128, diff --git a/test/libraries/ProtocolFeeLibrary.t.sol b/test/libraries/ProtocolFeeLibrary.t.sol index ba341a4d6..a748c8e57 100644 --- a/test/libraries/ProtocolFeeLibrary.t.sol +++ b/test/libraries/ProtocolFeeLibrary.t.sol @@ -12,7 +12,7 @@ contract ProtocolFeeLibraryTest is Test, GasSnapshot { assertEq(ProtocolFeeLibrary.getZeroForOneFee(fee), uint24(ProtocolFeeLibrary.MAX_PROTOCOL_FEE)); } - function test_fuzz_getZeroForOneFee(uint24 fee) public pure { + function test_getZeroForOneFee_fuzz(uint24 fee) public pure { assertEq(ProtocolFeeLibrary.getZeroForOneFee(fee), fee % 4096); } @@ -21,7 +21,7 @@ contract ProtocolFeeLibraryTest is Test, GasSnapshot { assertEq(ProtocolFeeLibrary.getOneForZeroFee(fee), uint24(ProtocolFeeLibrary.MAX_PROTOCOL_FEE - 1)); } - function test_fuzz_getOneForZeroFee(uint24 fee) public pure { + function test_getOneForZeroFee_fuzz(uint24 fee) public pure { assertEq(ProtocolFeeLibrary.getOneForZeroFee(fee), fee >> 12); } @@ -45,7 +45,7 @@ contract ProtocolFeeLibraryTest is Test, GasSnapshot { assertTrue(ProtocolFeeLibrary.isValidProtocolFee(fee)); } - function test_fuzz_isValidProtocolFee(uint24 fee) public pure { + function test_isValidProtocolFee_fuzz(uint24 fee) public pure { if ((fee >> 12 > ProtocolFeeLibrary.MAX_PROTOCOL_FEE) || (fee % 4096 > ProtocolFeeLibrary.MAX_PROTOCOL_FEE)) { assertFalse(ProtocolFeeLibrary.isValidProtocolFee(fee)); } else { @@ -67,7 +67,7 @@ contract ProtocolFeeLibraryTest is Test, GasSnapshot { assertEq(ProtocolFeeLibrary.calculateSwapFee(0, 1000), 1000); } - function test_fuzz_calculateSwapFee(uint16 protocolFee, uint24 lpFee) public pure { + function test_calculateSwapFee_fuzz(uint16 protocolFee, uint24 lpFee) public pure { protocolFee = uint16(bound(protocolFee, 0, ProtocolFeeLibrary.MAX_PROTOCOL_FEE)); lpFee = uint24(bound(lpFee, 0, LPFeeLibrary.MAX_LP_FEE)); uint24 swapFee = ProtocolFeeLibrary.calculateSwapFee(protocolFee, lpFee); diff --git a/test/libraries/SafeCast.t.sol b/test/libraries/SafeCast.t.sol index 40d873f03..58556efd2 100644 --- a/test/libraries/SafeCast.t.sol +++ b/test/libraries/SafeCast.t.sol @@ -6,7 +6,7 @@ import {Vm} from "forge-std/Vm.sol"; import {SafeCast} from "../../src/libraries/SafeCast.sol"; contract SafeCastTest is Test { - function test_fuzz_toUint160(uint256 x) public { + function test_toUint160_fuzz(uint256 x) public { if (x <= type(uint160).max) { assertEq(uint256(SafeCast.toUint160(x)), x); } else { @@ -22,7 +22,7 @@ contract SafeCastTest is Test { SafeCast.toUint160(type(uint160).max + uint256(1)); } - function test_fuzz_toUint128(uint256 x) public { + function test_toUint128_fuzz(uint256 x) public { if (x <= type(uint128).max) { assertEq(uint256(SafeCast.toUint128(x)), x); } else { @@ -38,7 +38,7 @@ contract SafeCastTest is Test { SafeCast.toUint128(type(uint128).max + uint256(1)); } - function test_fuzz_toInt128_fromInt256(int256 x) public { + function test_toInt128_fromInt256_fuzz(int256 x) public { if (x <= type(int128).max && x >= type(int128).min) { assertEq(int256(SafeCast.toInt128(x)), x); } else { @@ -57,7 +57,7 @@ contract SafeCastTest is Test { SafeCast.toInt128(type(int128).min - int256(1)); } - function test_fuzz_toInt256(uint256 x) public { + function test_toInt256_fuzz(uint256 x) public { if (x <= uint256(type(int256).max)) { assertEq(uint256(SafeCast.toInt256(x)), x); } else { @@ -73,7 +73,7 @@ contract SafeCastTest is Test { SafeCast.toInt256(uint256(type(int256).max) + uint256(1)); } - function test_fuzz_toInt128_fromUint256(uint256 x) public { + function test_toInt128_fromUint256_fuzz(uint256 x) public { if (x <= uint128(type(int128).max)) { assertEq(uint128(SafeCast.toInt128(x)), x); } else { diff --git a/test/libraries/StateLibrary.t.sol b/test/libraries/StateLibrary.t.sol index dd5c6861b..ae52fc827 100644 --- a/test/libraries/StateLibrary.t.sol +++ b/test/libraries/StateLibrary.t.sol @@ -74,7 +74,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(liquidityNetUpper, -10 ether); } - function test_fuzz_getTickLiquidity(IPoolManager.ModifyLiquidityParams memory params) public { + function test_getTickLiquidity_fuzz(IPoolManager.ModifyLiquidityParams memory params) public { (IPoolManager.ModifyLiquidityParams memory _params,) = Fuzzers.createFuzzyLiquidity(modifyLiquidityRouter, key, params, SQRT_PRICE_1_1, ZERO_BYTES); uint128 liquidityDelta = uint128(uint256(_params.liquidityDelta)); @@ -101,7 +101,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(_liquidityNetUpper, liquidityNetUpper); } - function test_fuzz_getTickLiquidity_two_positions( + function test_getTickLiquidity_two_positions_fuzz( IPoolManager.ModifyLiquidityParams memory paramsA, IPoolManager.ModifyLiquidityParams memory paramsB ) public { @@ -224,7 +224,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(liquidity, 20 ether); } - function test_fuzz_getLiquidity(IPoolManager.ModifyLiquidityParams memory params) public { + function test_getLiquidity_fuzz(IPoolManager.ModifyLiquidityParams memory params) public { (IPoolManager.ModifyLiquidityParams memory _params,) = Fuzzers.createFuzzyLiquidity(modifyLiquidityRouter, key, params, SQRT_PRICE_1_1, ZERO_BYTES); (, int24 tick,,) = StateLibrary.getSlot0(manager, poolId); @@ -258,7 +258,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(tickBitmap, 1 << bitPos); } - function test_fuzz_getTickBitmap(IPoolManager.ModifyLiquidityParams memory params) public { + function test_getTickBitmap_fuzz(IPoolManager.ModifyLiquidityParams memory params) public { (IPoolManager.ModifyLiquidityParams memory _params,) = Fuzzers.createFuzzyLiquidity(modifyLiquidityRouter, key, params, SQRT_PRICE_1_1, ZERO_BYTES); @@ -304,7 +304,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(feeGrowthInside1X128, 0); } - function test_fuzz_getPositionInfo( + function test_getPositionInfo_fuzz( IPoolManager.ModifyLiquidityParams memory params, uint256 swapAmount, bool zeroForOne @@ -447,7 +447,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(feeGrowthInside1X128, feeGrowthInside1X128_); } - function test_fuzz_getFeeGrowthInside(IPoolManager.ModifyLiquidityParams memory params, bool zeroForOne) public { + function test_getFeeGrowthInside_fuzz(IPoolManager.ModifyLiquidityParams memory params, bool zeroForOne) public { modifyLiquidityRouter.modifyLiquidity( key, IPoolManager.ModifyLiquidityParams( @@ -495,7 +495,7 @@ contract StateLibraryTest is Test, Deployers, Fuzzers, GasSnapshot { assertEq(liquidity, 10_000 ether); } - function test_fuzz_getPositionLiquidity( + function test_getPositionLiquidity_fuzz( IPoolManager.ModifyLiquidityParams memory paramsA, IPoolManager.ModifyLiquidityParams memory paramsB ) public { diff --git a/test/libraries/SwapMath.t.sol b/test/libraries/SwapMath.t.sol index 043931869..f29698e34 100644 --- a/test/libraries/SwapMath.t.sol +++ b/test/libraries/SwapMath.t.sol @@ -16,7 +16,7 @@ contract SwapMathTest is Test, GasSnapshot { uint160 private constant SQRT_PRICE_1010_100 = 251791039410471229173201122529; uint160 private constant SQRT_PRICE_10000_100 = 792281625142643375935439503360; - function test_fuzz_getSqrtPriceTarget(bool zeroForOne, uint160 sqrtPriceNextX96, uint160 sqrtPriceLimitX96) + function test_getSqrtPriceTarget_fuzz(bool zeroForOne, uint160 sqrtPriceNextX96, uint160 sqrtPriceLimitX96) public pure { @@ -186,7 +186,7 @@ contract SwapMathTest is Test, GasSnapshot { assertEq(feeAmount, 1); } - function test_fuzz_computeSwapStep( + function test_computeSwapStep_fuzz( uint160 sqrtPriceRaw, uint160 sqrtPriceTargetRaw, uint128 liquidity, diff --git a/test/libraries/TickBitmap.t.sol b/test/libraries/TickBitmap.t.sol index 570addf81..0e856574c 100644 --- a/test/libraries/TickBitmap.t.sol +++ b/test/libraries/TickBitmap.t.sol @@ -25,14 +25,14 @@ contract TickBitmapTest is Test, GasSnapshot { } } - function test_fuzz_compress(int24 tick, int24 tickSpacing) public pure { + function test_compress_fuzz(int24 tick, int24 tickSpacing) public pure { tickSpacing = int24(bound(tickSpacing, 1, type(int24).max)); int24 compressed = tick / tickSpacing; if (tick < 0 && tick % tickSpacing != 0) compressed--; assertEq(TickBitmap.compress(tick, tickSpacing), compressed); } - function test_fuzz_position(int24 tick) public pure { + function test_position_fuzz(int24 tick) public pure { (int16 wordPos, uint8 bitPos) = TickBitmap.position(tick); assertEq(wordPos, tick >> 8); assertEq(bitPos, uint8(int8(tick % 256))); @@ -112,7 +112,7 @@ contract TickBitmapTest is Test, GasSnapshot { snapEnd(); } - function test_fuzz_flipTick(int24 tick, int24 tickSpacing) public { + function test_flipTick_fuzz(int24 tick, int24 tickSpacing) public { tickSpacing = int24(bound(tickSpacing, 1, type(int24).max)); if (tick % tickSpacing != 0) { @@ -294,7 +294,7 @@ contract TickBitmapTest is Test, GasSnapshot { snapEnd(); } - function test_fuzz_nextInitializedTickWithinOneWord(int24 tick, bool lte) public view { + function test_nextInitializedTickWithinOneWord_fuzz(int24 tick, bool lte) public view { // assume tick is at least one word inside type(int24).(max | min) vm.assume(lte ? tick >= -8388352 : tick < 8388351); @@ -319,7 +319,7 @@ contract TickBitmapTest is Test, GasSnapshot { } } - function test_fuzz_nextInitializedTickWithinOneWord_onEmptyBitmap( + function test_nextInitializedTickWithinOneWord_onEmptyBitmap_fuzz( int24 tick, int24 tickSpacing, uint8 nextBitPos, diff --git a/test/libraries/TickMath.t.sol b/test/libraries/TickMath.t.sol index d1f5bffc8..0f89e2fae 100644 --- a/test/libraries/TickMath.t.sol +++ b/test/libraries/TickMath.t.sol @@ -63,7 +63,7 @@ contract TickMathTestTest is Test, JavascriptFfi, GasSnapshot { tickMath.getSqrtPriceAtTick(tick); } - function test_fuzz_getSqrtPriceAtTick_throwsForTooLarge(int24 tick) public { + function test_getSqrtPriceAtTick_throwsForTooLarge_fuzz(int24 tick) public { if (tick > 0) { tick = int24(bound(tick, MAX_TICK + 1, type(int24).max)); } else { @@ -117,7 +117,7 @@ contract TickMathTestTest is Test, JavascriptFfi, GasSnapshot { tickMath.getTickAtSqrtPrice(sqrtPriceX96); } - function test_fuzz_getTickAtSqrtPrice_throwsForInvalid(uint160 sqrtPriceX96, bool gte) public { + function test_getTickAtSqrtPrice_throwsForInvalid_fuzz(uint160 sqrtPriceX96, bool gte) public { if (gte) { sqrtPriceX96 = uint160(bound(sqrtPriceX96, MAX_SQRT_PRICE, type(uint160).max)); } else { diff --git a/test/libraries/UnsafeMath.t.sol b/test/libraries/UnsafeMath.t.sol index 3743425bd..62c1ef99b 100644 --- a/test/libraries/UnsafeMath.t.sol +++ b/test/libraries/UnsafeMath.t.sol @@ -23,7 +23,7 @@ contract UnsafeMathTest is Test { assertEq(Q128.divRoundingUp(3), result); } - function test_fuzz_divRoundingUp(uint256 x, uint256 y) public pure { + function test_divRoundingUp_fuzz(uint256 x, uint256 y) public pure { vm.assume(y != 0); uint256 result = x.divRoundingUp(y); assertTrue(result == x / y || result == x / y + 1); diff --git a/test/types/BalanceDelta.t.sol b/test/types/BalanceDelta.t.sol index d79b8fcbc..02dd3b9ac 100644 --- a/test/types/BalanceDelta.t.sol +++ b/test/types/BalanceDelta.t.sol @@ -27,13 +27,13 @@ contract TestBalanceDelta is Test { assertEq(balanceDelta.amount1(), type(int128).min); } - function test_fuzz_toBalanceDelta(int128 x, int128 y) public pure { + function test_toBalanceDelta_fuzz(int128 x, int128 y) public pure { BalanceDelta balanceDelta = toBalanceDelta(x, y); int256 expectedBD = int256(uint256(bytes32(abi.encodePacked(x, y)))); assertEq(BalanceDelta.unwrap(balanceDelta), expectedBD); } - function test_fuzz_amount0_amount1(int128 x, int128 y) public pure { + function test_amount0_amount1_fuzz(int128 x, int128 y) public pure { BalanceDelta balanceDelta = toBalanceDelta(x, y); assertEq(balanceDelta.amount0(), x); assertEq(balanceDelta.amount1(), y); @@ -68,7 +68,7 @@ contract TestBalanceDelta is Test { toBalanceDelta(0, type(int128).max) + toBalanceDelta(0, 1); } - function test_fuzz_add(int128 a, int128 b, int128 c, int128 d) public { + function test_add_fuzz(int128 a, int128 b, int128 c, int128 d) public { int256 ac = int256(a) + c; int256 bd = int256(b) + d; @@ -111,7 +111,7 @@ contract TestBalanceDelta is Test { toBalanceDelta(0, type(int128).min) - toBalanceDelta(0, 1); } - function test_fuzz_sub(int128 a, int128 b, int128 c, int128 d) public { + function test_sub_fuzz(int128 a, int128 b, int128 c, int128 d) public { int256 ac = int256(a) - c; int256 bd = int256(b) - d; @@ -125,13 +125,13 @@ contract TestBalanceDelta is Test { assertEq(balanceDelta.amount1(), bd); } - function test_fuzz_eq(int128 a, int128 b, int128 c, int128 d) public pure { + function test_eq_fuzz(int128 a, int128 b, int128 c, int128 d) public pure { bool isEqual = (toBalanceDelta(a, b) == toBalanceDelta(c, d)); if (a == c && b == d) assertTrue(isEqual); else assertFalse(isEqual); } - function test_fuzz_neq(int128 a, int128 b, int128 c, int128 d) public pure { + function test_neq_fuzz(int128 a, int128 b, int128 c, int128 d) public pure { bool isNotEqual = (toBalanceDelta(a, b) != toBalanceDelta(c, d)); if (a != c || b != d) assertTrue(isNotEqual); else assertFalse(isNotEqual); diff --git a/test/types/Currency.t.sol b/test/types/Currency.t.sol index bbebd52fc..2b880e2b2 100644 --- a/test/types/Currency.t.sol +++ b/test/types/Currency.t.sol @@ -25,23 +25,23 @@ contract TestCurrency is Test { erc20Currency = Currency.wrap(address(token)); } - function test_fuzz_equals(address a, address b) public pure { + function test_equals_fuzz(address a, address b) public pure { assertEq(a == b, Currency.wrap(a) == Currency.wrap(b)); } - function test_fuzz_greaterThan(address a, address b) public pure { + function test_greaterThan_fuzz(address a, address b) public pure { assertEq(a > b, Currency.wrap(a) > Currency.wrap(b)); } - function test_fuzz_lessThan(address a, address b) public pure { + function test_lessThan_fuzz(address a, address b) public pure { assertEq(a < b, Currency.wrap(a) < Currency.wrap(b)); } - function test_fuzz_greaterThanOrEqualTo(address a, address b) public pure { + function test_greaterThanOrEqualTo_fuzz(address a, address b) public pure { assertEq(a >= b, Currency.wrap(a) >= Currency.wrap(b)); } - function test_fuzz_balanceOfSelf_native(uint256 amount) public { + function test_balanceOfSelf_native_fuzz(uint256 amount) public { uint256 balanceBefore = address(currencyTest).balance; amount = bound(amount, 0, balanceBefore); currencyTest.transfer(nativeCurrency, otherAddress, amount); @@ -49,7 +49,7 @@ contract TestCurrency is Test { assertEq(currencyTest.balanceOfSelf(nativeCurrency), address(currencyTest).balance); } - function test_fuzz_balanceOfSelf_token(uint256 amount) public { + function test_balanceOfSelf_token_fuzz(uint256 amount) public { amount = bound(amount, 0, initialERC20Balance); currencyTest.transfer(erc20Currency, otherAddress, amount); assertEq(currencyTest.balanceOfSelf(erc20Currency), initialERC20Balance - amount); @@ -59,7 +59,7 @@ contract TestCurrency is Test { ); } - function test_fuzz_balanceOf_native(uint256 amount) public { + function test_balanceOf_native_fuzz(uint256 amount) public { uint256 currencyBalanceBefore = address(currencyTest).balance; amount = bound(amount, 0, address(currencyTest).balance); currencyTest.transfer(nativeCurrency, otherAddress, amount); @@ -69,7 +69,7 @@ contract TestCurrency is Test { assertEq(otherAddress.balance, currencyTest.balanceOf(nativeCurrency, otherAddress)); } - function test_fuzz_balanceOf_token(uint256 amount) public { + function test_balanceOf_token_fuzz(uint256 amount) public { amount = bound(amount, 0, initialERC20Balance); currencyTest.transfer(erc20Currency, otherAddress, amount); assertEq(currencyTest.balanceOf(erc20Currency, otherAddress), amount); @@ -88,7 +88,7 @@ contract TestCurrency is Test { assertEq(currencyTest.isNative(erc20Currency), false); } - function test_fuzz_isNative(Currency currency) public view { + function test_isNative_fuzz(Currency currency) public view { assertEq(currencyTest.isNative(currency), (Currency.unwrap(currency) == address(0))); } @@ -96,7 +96,7 @@ contract TestCurrency is Test { assertEq(currencyTest.toId(nativeCurrency), uint256(0)); } - function test_fuzz_toId_returnsCurrencyAsUint256(Currency currency) public view { + function test_toId_returnsCurrencyAsUint256_fuzz(Currency currency) public view { assertEq(currencyTest.toId(currency), uint256(uint160(Currency.unwrap(currency)))); } @@ -104,16 +104,16 @@ contract TestCurrency is Test { assertEq(Currency.unwrap(currencyTest.fromId(0)), Currency.unwrap(nativeCurrency)); } - function test_fuzz_fromId_returnsUint256AsCurrency(uint256 id) public view { + function test_fromId_returnsUint256AsCurrency_fuzz(uint256 id) public view { uint160 expectedCurrency = uint160(uint256(type(uint160).max) & id); assertEq(Currency.unwrap(currencyTest.fromId(id)), address(expectedCurrency)); } - function test_fuzz_fromId_toId_opposites(Currency currency) public view { + function test_fromId_toId_opposites_fuzz(Currency currency) public view { assertEq(Currency.unwrap(currency), Currency.unwrap(currencyTest.fromId(currencyTest.toId(currency)))); } - function test_fuzz_toId_fromId_opposites(uint256 id) public view { + function test_toId_fromId_opposites_fuzz(uint256 id) public view { assertEq(id & 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, currencyTest.toId(currencyTest.fromId(id))); } @@ -125,7 +125,7 @@ contract TestCurrency is Test { currencyTest.transfer(Currency.wrap(address(emptyRevertingToken)), otherAddress, 100); } - function test_fuzz_transfer_native(uint256 amount) public { + function test_transfer_native_fuzz(uint256 amount) public { uint256 balanceBefore = otherAddress.balance; uint256 contractBalanceBefore = address(currencyTest).balance; @@ -140,7 +140,7 @@ contract TestCurrency is Test { } } - function test_fuzz_transfer_token(uint256 amount) public { + function test_transfer_token_fuzz(uint256 amount) public { uint256 balanceBefore = currencyTest.balanceOf(erc20Currency, otherAddress); if (amount <= initialERC20Balance) { diff --git a/test/types/Slot0.t.sol b/test/types/Slot0.t.sol index 29c353a50..93853c35a 100644 --- a/test/types/Slot0.t.sol +++ b/test/types/Slot0.t.sol @@ -10,7 +10,7 @@ contract TestSlot0 is Test { assertEq(Slot0Library.MASK_24_BITS, type(uint24).max); } - function test_fuzz_slot0_pack_unpack(uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee) + function test_slot0_pack_unpack_fuzz(uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee) public pure {