feat: rm selector from usv3, usv4, update tests, and rename dispatcher file

This commit is contained in:
royvardhan
2025-02-24 17:16:27 +05:30
parent 58116e074a
commit 69745b18fd
10 changed files with 31 additions and 140 deletions

View File

@@ -12,15 +12,12 @@ contract LibSwapTest is Test {
uint8 tokenOutIndex = 2;
uint24 split = 3;
address executor = 0x1234567890123456789012345678901234567890;
bytes4 selector = 0x12345678;
bytes memory protocolData = abi.encodePacked(uint256(456));
bytes memory swap = abi.encodePacked(
tokenInIndex, tokenOutIndex, split, executor, selector, protocolData
);
this.assertSwap(
swap, tokenInIndex, tokenOutIndex, split, executor, selector
tokenInIndex, tokenOutIndex, split, executor, protocolData
);
this.assertSwap(swap, tokenInIndex, tokenOutIndex, split, executor);
}
// This is necessary so that the compiler accepts bytes as a LibSwap.sol
@@ -29,13 +26,11 @@ contract LibSwapTest is Test {
uint8 tokenInIndex,
uint8 tokenOutIndex,
uint24 split,
address executor,
bytes4 selector
address executor
) public pure {
assert(swap.tokenInIndex() == tokenInIndex);
assert(swap.tokenOutIndex() == tokenOutIndex);
assert(swap.splitPercentage() == split);
assert(swap.executor() == executor);
assert(swap.executorSelector() == selector);
}
}