From 7fa5bcec673ded01f2857d6b9984c76b1bb75110 Mon Sep 17 00:00:00 2001 From: Eric Zhong Date: Wed, 29 Nov 2023 22:11:03 -0500 Subject: [PATCH] forge fmt --- src/reactors/RelayOrderReactor.sol | 1 - .../RelayOrderReactorIntegration.t.sol | 23 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/reactors/RelayOrderReactor.sol b/src/reactors/RelayOrderReactor.sol index 8a19b544..7cb56c60 100644 --- a/src/reactors/RelayOrderReactor.sol +++ b/src/reactors/RelayOrderReactor.sol @@ -69,7 +69,6 @@ contract RelayOrderReactor is ReactorEvents, ReactorErrors, ReentrancyGuard, IRe for (uint256 j = 0; j < actionsLength;) { (address target, uint256 value, bytes memory data) = abi.decode(order.actions[j], (address, uint256, bytes)); - (bool success,) = target.call{value: value}(data); if (!success) revert CallFailed(); unchecked { diff --git a/test/foundry-tests/integration/RelayOrderReactorIntegration.t.sol b/test/foundry-tests/integration/RelayOrderReactorIntegration.t.sol index e63ab8a2..ae318a27 100644 --- a/test/foundry-tests/integration/RelayOrderReactorIntegration.t.sol +++ b/test/foundry-tests/integration/RelayOrderReactorIntegration.t.sol @@ -175,7 +175,7 @@ contract RelayOrderReactorIntegrationTest is GasSnapshot, Test, Interop, PermitS address(PERMIT2), type(uint256).max - 1, // infinite approval USDC.nonces(swapper2), - type(uint256).max - 1 // infinite deadline + type(uint256).max - 1 // infinite deadline ) ) ) @@ -185,8 +185,9 @@ contract RelayOrderReactorIntegrationTest is GasSnapshot, Test, Interop, PermitS address signer = ecrecover(digest, v, r, s); assertEq(signer, swapper2); - bytes memory permitData = - abi.encode(address(USDC), abi.encode(swapper2, address(PERMIT2), type(uint256).max - 1, type(uint256).max - 1, v, r, s)); + bytes memory permitData = abi.encode( + address(USDC), abi.encode(swapper2, address(PERMIT2), type(uint256).max - 1, type(uint256).max - 1, v, r, s) + ); bytes[] memory actions = new bytes[](1); MethodParameters memory methodParameters = readFixture(json, "._UNISWAP_V3_USDC_DAI"); @@ -219,12 +220,18 @@ contract RelayOrderReactorIntegrationTest is GasSnapshot, Test, Interop, PermitS assertEq(tokenOut.balanceOf(address(reactor)), 0, "No leftover output in reactor"); // swapper must have spent 100 USDC for the swap and 10 USDC for gas assertEq( - tokenIn.balanceOf(swapper2), swapperInputBalanceStart - 100 * USDC_ONE - 10 * USDC_ONE, "Swapper input tokens" + tokenIn.balanceOf(swapper2), + swapperInputBalanceStart - 100 * USDC_ONE - 10 * USDC_ONE, + "Swapper input tokens" ); assertGe( - tokenOut.balanceOf(swapper2), swapperOutputBalanceStart + amountOutMin, "Swapper did not receive enough output" + tokenOut.balanceOf(swapper2), + swapperOutputBalanceStart + amountOutMin, + "Swapper did not receive enough output" + ); + assertEq( + tokenIn.balanceOf(address(permitExecutor)), fillerGasInputBalanceStart + 10 * USDC_ONE, "executor balance" ); - assertEq(tokenIn.balanceOf(address(permitExecutor)), fillerGasInputBalanceStart + 10 * USDC_ONE, "executor balance"); } // swapper creates one order containing a universal router swap for 100 DAI -> ETH @@ -318,7 +325,9 @@ contract RelayOrderReactorIntegrationTest is GasSnapshot, Test, Interop, PermitS reactor.execute{value: methodParameters.value}(signedOrder); } - function _checkpointBalances(address _swapper, address _filler, ERC20 tokenIn, ERC20 tokenOut, ERC20 gasInput) internal { + function _checkpointBalances(address _swapper, address _filler, ERC20 tokenIn, ERC20 tokenOut, ERC20 gasInput) + internal + { swapperInputBalanceStart = tokenIn.balanceOf(_swapper); swapperOutputBalanceStart = tokenOut.balanceOf(_swapper); routerInputBalanceStart = tokenIn.balanceOf(UNIVERSAL_ROUTER);