test: Thorough tests for main SwapExecutionDispatcher method

This commit is contained in:
TAMARA LIPOWSKI
2025-01-23 15:01:21 -05:00
parent e91ee96129
commit 825af0f8d7
3 changed files with 68 additions and 8 deletions

View File

@@ -24,11 +24,10 @@ contract SwapExecutionDispatcher {
* @dev Calls an executor, assumes swap.protocolData contains
* token addresses if required by the executor.
*/
function _callSwapExecutor(
uint8 exchange,
uint256 amount,
bytes calldata data
) internal returns (uint256 calculatedAmount) {
function _callSwapExecutor(uint256 amount, bytes calldata data)
internal
returns (uint256 calculatedAmount)
{
address executor;
bytes4 decodedSelector;
bytes memory protocolData;
@@ -40,7 +39,7 @@ contract SwapExecutionDispatcher {
? ISwapExecutor.swap.selector
: decodedSelector;
if (!swapExecutors[executor]){
if (!swapExecutors[executor]) {
revert SwapExecutionDispatcher__UnapprovedExecutor();
}