Revert "ENG-3406: Add new bytes parameter to swap"

This commit is contained in:
Pierre
2024-08-08 22:24:35 +02:00
committed by GitHub
parent 9ef9782451
commit b3e3672172
13 changed files with 46 additions and 114 deletions

View File

@@ -16,7 +16,6 @@ contract IntegralSwapAdapterTest is Test, ISwapAdapterTypes {
address constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address constant USDC_WETH_PAIR = 0x2fe16Dd18bba26e457B7dD2080d5674312b026a2;
address constant relayerAddress = 0xd17b3c9784510E33cD5B87b490E79253BcD81e2E;
bytes32 mockData;
uint256 constant TEST_ITERATIONS = 100;
@@ -31,10 +30,7 @@ contract IntegralSwapAdapterTest is Test, ISwapAdapterTypes {
vm.label(address(USDC_WETH_PAIR), "USDC_WETH_PAIR");
}
function testPriceFuzzIntegral(uint256 amount0, uint256 amount1)
public
view
{
function testPriceFuzzIntegral(uint256 amount0, uint256 amount1) public {
bytes32 pair = bytes32(bytes20(USDC_WETH_PAIR));
uint256[] memory limits = adapter.getLimits(pair, USDC, WETH);
vm.assume(amount0 < limits[0]);
@@ -87,7 +83,7 @@ contract IntegralSwapAdapterTest is Test, ISwapAdapterTypes {
uint256 weth_balance_before = IERC20(WETH).balanceOf(address(this));
Trade memory trade =
adapter.swap(pair, USDC, WETH, side, specifiedAmount, mockData);
adapter.swap(pair, USDC, WETH, side, specifiedAmount);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -142,8 +138,7 @@ contract IntegralSwapAdapterTest is Test, ISwapAdapterTypes {
deal(USDC, address(this), amounts[i]);
IERC20(USDC).approve(address(adapter), amounts[i]);
trades[i] =
adapter.swap(pair, USDC, WETH, side, amounts[i], mockData);
trades[i] = adapter.swap(pair, USDC, WETH, side, amounts[i]);
vm.revertTo(beforeSwap);
}
@@ -162,14 +157,14 @@ contract IntegralSwapAdapterTest is Test, ISwapAdapterTypes {
assertEq(res.length, 4);
}
function testGetTokensIntegral() public view {
function testGetTokensIntegral() public {
bytes32 pair = bytes32(bytes20(USDC_WETH_PAIR));
address[] memory tokens = adapter.getTokens(pair);
assertEq(tokens.length, 2);
}
function testGetLimitsIntegral() public view {
function testGetLimitsIntegral() public {
bytes32 pair = bytes32(bytes20(USDC_WETH_PAIR));
uint256[] memory limits = adapter.getLimits(pair, USDC, WETH);