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

@@ -29,7 +29,7 @@ contract UniswapV2PairFunctionTest is AdapterTest {
vm.label(USDC_WETH_PAIR, "USDC_WETH_PAIR");
}
function testPriceFuzz(uint256 amount0, uint256 amount1) public view {
function testPriceFuzz(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]);
@@ -47,7 +47,7 @@ contract UniswapV2PairFunctionTest is AdapterTest {
}
}
function testPriceDecreasing() public view {
function testPriceDecreasing() public {
bytes32 pair = bytes32(bytes20(USDC_WETH_PAIR));
uint256[] memory amounts = new uint256[](TEST_ITERATIONS);
@@ -88,7 +88,7 @@ contract UniswapV2PairFunctionTest is AdapterTest {
uint256 weth_balance = 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) {
@@ -133,8 +133,7 @@ contract UniswapV2PairFunctionTest is AdapterTest {
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);
}
@@ -149,16 +148,13 @@ contract UniswapV2PairFunctionTest is AdapterTest {
executeIncreasingSwaps(OrderSide.Buy);
}
function testGetCapabilities(bytes32 pair, address t0, address t1)
public
view
{
function testGetCapabilities(bytes32 pair, address t0, address t1) public {
Capability[] memory res = adapter.getCapabilities(pair, t0, t1);
assertEq(res.length, 4);
}
function testGetLimits() public view {
function testGetLimits() public {
bytes32 pair = bytes32(bytes20(USDC_WETH_PAIR));
uint256[] memory limits = adapter.getLimits(pair, USDC, WETH);