From 63e6b80a74f5987d090bf24b162715e80ea28426 Mon Sep 17 00:00:00 2001 From: nowonder Date: Tue, 2 Apr 2024 20:33:42 +0000 Subject: [PATCH] cleanup unused vars --- .../TestSendReservedTokensToSplitsOf.sol | 10 -- .../JBMultiTerminal/TestExecutePayout.sol | 111 ------------------ 2 files changed, 121 deletions(-) diff --git a/test/units/static/JBController/TestSendReservedTokensToSplitsOf.sol b/test/units/static/JBController/TestSendReservedTokensToSplitsOf.sol index d13c0678..fa49a028 100644 --- a/test/units/static/JBController/TestSendReservedTokensToSplitsOf.sol +++ b/test/units/static/JBController/TestSendReservedTokensToSplitsOf.sol @@ -265,16 +265,6 @@ contract TestSendReservedTokensToSplitsOf_Local is JBControllerSetup { bytes memory _tokensMintCall = abi.encodeCall(IJBTokens.mintFor, (_beneficiary, _projectId, _tokenCount)); mockExpect(address(tokens), _tokensMintCall, ""); - // split hook data - JBSplitHookContext memory _context = JBSplitHookContext({ - token: address(_token), - amount: _tokenCount, - decimals: _decimals, - projectId: 0, - groupId: 1, - split: _splits[0] - }); - vm.expectEmit(); emit IJBController.SendReservedTokensToSplit( _projectId, block.timestamp, 1, _splits[0], _tokenCount, address(this) diff --git a/test/units/static/JBMultiTerminal/TestExecutePayout.sol b/test/units/static/JBMultiTerminal/TestExecutePayout.sol index de7ac9fe..1159f7e0 100644 --- a/test/units/static/JBMultiTerminal/TestExecutePayout.sol +++ b/test/units/static/JBMultiTerminal/TestExecutePayout.sol @@ -172,16 +172,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: _defaultAmount - taxedAmount, // It will call with taxed amount - decimals: 0, - projectId: _noProject, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call to usdc transfer mockExpect( address(_usdc), @@ -220,18 +210,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { hook: IJBSplitHook(address(0)) }); - uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); - - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _native, - amount: _defaultAmount - taxedAmount, // It will call with taxed amount - decimals: 0, - projectId: _projectId, - groupId: uint256(uint160(_native)), - split: _splitMemory - }); - vm.expectRevert(bytes("404_2")); vm.prank(address(_terminal)); _terminal.executePayout({ @@ -262,19 +240,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { hook: IJBSplitHook(address(0)) }); - uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); - uint256 amountAfterTax = _defaultAmount - taxedAmount; - - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, // It will call with taxed amount - decimals: 0, - projectId: _projectId, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call to JBTerminalStore recordAddedBalanceFor mockExpect( address(store), @@ -323,16 +288,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); uint256 amountAfterTax = _defaultAmount - taxedAmount; - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, // It will call with taxed amount - decimals: 0, - projectId: _projectId, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call for SafeERC20s allowance check mockExpect( _usdc, abi.encodeCall(IERC20.allowance, (address(_terminal), address(_mockSecondTerminal))), abi.encode(0) @@ -380,19 +335,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { hook: IJBSplitHook(address(0)) }); - uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); - uint256 amountAfterTax = _defaultAmount - taxedAmount; - - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, // It will call with taxed amount - decimals: 0, - projectId: _projectId, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // needed for next mock call returns JBTokenAmount memory tokenAmount = JBTokenAmount(_usdc, _defaultAmount, 0, 0); JBPayHookSpecification[] memory hookSpecifications = new JBPayHookSpecification[](0); @@ -459,16 +401,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); uint256 amountAfterTax = _defaultAmount - taxedAmount; - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, // It will call with taxed amount - decimals: 0, - projectId: _projectId, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call for SafeERC20s allowance check mockExpect( _usdc, abi.encodeCall(IERC20.allowance, (address(_terminal), address(_mockSecondTerminal))), abi.encode(0) @@ -514,16 +446,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { hook: IJBSplitHook(address(0)) }); - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: _defaultAmount, - decimals: 0, - projectId: _noProject, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call to usdc transfer mockExpect(address(_usdc), abi.encodeCall(IERC20.transfer, (address(_bene), _defaultAmount)), abi.encode(true)); @@ -561,16 +483,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); uint256 amountAfterTax = _defaultAmount - taxedAmount; - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, - decimals: 0, - projectId: _noProject, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call to usdc transfer mockExpect(address(_usdc), abi.encodeCall(IERC20.transfer, (address(_bene), amountAfterTax)), abi.encode(true)); @@ -606,16 +518,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); uint256 amountAfterTax = _defaultAmount - taxedAmount; - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, - decimals: 0, - projectId: _noProject, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - // mock call to usdc transfer mockExpect(address(_usdc), abi.encodeCall(IERC20.transfer, (address(this), amountAfterTax)), abi.encode(true)); @@ -643,19 +545,6 @@ contract TestExecutePayout_Local is JBMultiTerminalSetup { hook: IJBSplitHook(address(0)) }); - uint256 taxedAmount = JBFees.feeAmountIn(_defaultAmount, _fee); - uint256 amountAfterTax = _defaultAmount - taxedAmount; - - // Create the context to send to the split hook. - JBSplitHookContext memory context = JBSplitHookContext({ - token: _usdc, - amount: amountAfterTax, - decimals: 0, - projectId: _noProject, - groupId: uint256(uint160(_usdc)), - split: _splitMemory - }); - vm.expectRevert(); _terminal.executePayout({ split: _splitMemory,