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

@@ -15,7 +15,6 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
IeEth eEth;
uint256 constant TEST_ITERATIONS = 100;
bytes32 mockData;
function setUp() public {
uint256 forkBlock = 19218495;
@@ -73,8 +72,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
address(address(0)),
address(eEth_),
OrderSide.Buy,
limits[0],
mockData
limits[0]
);
eEth_.approve(address(adapter), type(uint256).max);
@@ -89,8 +87,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
address(address(0)),
address(eEth_),
OrderSide.Buy,
specifiedAmount,
mockData
specifiedAmount
);
eEth_.approve(address(adapter), specifiedAmount);
@@ -100,12 +97,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
uint256 weEth_balance = weEth_.balanceOf(address(this));
Trade memory trade = adapter.swap(
pair,
address(eEth_),
address(weEth_),
side,
specifiedAmount,
mockData
pair, address(eEth_), address(weEth_), side, specifiedAmount
);
if (trade.calculatedAmount > 0) {
@@ -172,8 +164,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
address(address(0)),
address(weEth_),
OrderSide.Buy,
limits[0],
mockData
limits[0]
);
weEth_.approve(address(adapter), type(uint256).max);
@@ -188,8 +179,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
address(address(0)),
address(weEth_),
OrderSide.Buy,
specifiedAmount,
mockData
specifiedAmount
);
weEth_.approve(address(adapter), specifiedAmount);
@@ -204,12 +194,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
uint256 realAmountWeEth_ = weEth_balance - weEth_bal_before;
Trade memory trade = adapter.swap(
pair,
address(weEth_),
address(eEth_),
side,
realAmountWeEth_,
mockData
pair, address(weEth_), address(eEth_), side, realAmountWeEth_
);
if (trade.calculatedAmount > 0) {
@@ -269,9 +254,8 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
uint256 eth_balance = address(adapter).balance;
uint256 eEth_balance = eEth_.balanceOf(address(this));
Trade memory trade = adapter.swap(
pair, eth_, address(eEth_), side, specifiedAmount, mockData
);
Trade memory trade =
adapter.swap(pair, eth_, address(eEth_), side, specifiedAmount);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -325,9 +309,8 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
uint256 eth_balance = address(adapter).balance;
uint256 weEth_balance = weEth_.balanceOf(address(this));
Trade memory trade = adapter.swap(
pair, eth_, address(weEth_), side, specifiedAmount, mockData
);
Trade memory trade =
adapter.swap(pair, eth_, address(weEth_), side, specifiedAmount);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -390,8 +373,7 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
address(address(weEth)),
address(address(eEth)),
side,
amounts[i],
mockData
amounts[i]
);
vm.revertTo(beforeSwap);
}
@@ -404,7 +386,6 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
function testGetCapabilitiesEtherfi(bytes32 pair, address t0, address t1)
public
view
{
Capability[] memory res =
adapter.getCapabilities(pair, address(t0), address(t1));
@@ -412,14 +393,14 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
assertEq(res.length, 3);
}
function testGetTokensEtherfi() public view {
function testGetTokensEtherfi() public {
bytes32 pair = bytes32(0);
address[] memory tokens = adapter.getTokens(pair);
assertEq(tokens.length, 3);
}
function testGetLimitsEtherfi() public view {
function testGetLimitsEtherfi() public {
bytes32 pair = bytes32(0);
uint256[] memory limits =
adapter.getLimits(pair, address(eEth), address(weEth));