chore: forge fmt

This commit is contained in:
pistomat
2024-04-13 11:11:34 +00:00
parent 1738ca7bd2
commit 54e4c9f92e
4 changed files with 57 additions and 42 deletions

View File

@@ -36,7 +36,8 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
OrderSide side = isBuy ? OrderSide.Buy : OrderSide.Sell;
bytes32 pair = bytes32(0);
uint256[] memory limits = adapter.getLimits(pair, address(EURC), address(agEUR));
uint256[] memory limits =
adapter.getLimits(pair, address(EURC), address(agEUR));
if (side == OrderSide.Buy) {
vm.assume(specifiedAmount < limits[1] && specifiedAmount > 0);
@@ -53,8 +54,9 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
uint256 eurc_balance = EURC.balanceOf(address(this));
uint256 agEUR_balance = agEUR.balanceOf(address(this));
Trade memory trade =
adapter.swap(pair, address(EURC), address(agEUR), side, specifiedAmount);
Trade memory trade = adapter.swap(
pair, address(EURC), address(agEUR), side, specifiedAmount
);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -85,7 +87,8 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
OrderSide side = isBuy ? OrderSide.Buy : OrderSide.Sell;
bytes32 pair = bytes32(0);
uint256[] memory limits = adapter.getLimits(pair, address(agEUR), address(EURC));
uint256[] memory limits =
adapter.getLimits(pair, address(agEUR), address(EURC));
if (side == OrderSide.Buy) {
vm.assume(specifiedAmount < limits[1] && specifiedAmount > 0);
@@ -102,8 +105,9 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
uint256 eurc_balance = EURC.balanceOf(address(this));
uint256 agEUR_balance = agEUR.balanceOf(address(this));
Trade memory trade =
adapter.swap(pair, address(agEUR), address(EURC), side, specifiedAmount);
Trade memory trade = adapter.swap(
pair, address(agEUR), address(EURC), side, specifiedAmount
);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -154,7 +158,9 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
deal(address(agEUR), address(this), type(uint256).max);
agEUR.approve(address(adapter), type(uint256).max);
}
trades[i] = adapter.swap(pair, address(agEUR), address(EURC), side, amounts[i]);
trades[i] = adapter.swap(
pair, address(agEUR), address(EURC), side, amounts[i]
);
vm.revertTo(beforeSwap);
}
@@ -173,8 +179,7 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
function testGetCapabilitiesAngle(bytes32 pair, address t0, address t1)
public
{
Capability[] memory res =
adapter.getCapabilities(pair, t0, t1);
Capability[] memory res = adapter.getCapabilities(pair, t0, t1);
assertEq(res.length, 2);
}
@@ -187,7 +192,8 @@ contract AngleAdapterTest is Test, ISwapAdapterTypes {
function testGetLimitsAngle() public {
bytes32 pair = bytes32(0);
uint256[] memory limits = adapter.getLimits(pair, address(agEUR), address(EURC));
uint256[] memory limits =
adapter.getLimits(pair, address(agEUR), address(EURC));
assertEq(limits.length, 2);
}

View File

@@ -58,7 +58,8 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
IERC20 eEth_ = IERC20(address(eEth));
IERC20 weEth_ = IERC20(address(weEth));
bytes32 pair = bytes32(0);
uint256[] memory limits = adapter.getLimits(pair, address(eEth_), address(weEth_));
uint256[] memory limits =
adapter.getLimits(pair, address(eEth_), address(weEth_));
if (side == OrderSide.Buy) {
vm.assume(specifiedAmount < limits[1] && specifiedAmount > 100);
@@ -67,7 +68,11 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
/// work(balance is shares)
deal(address(adapter), type(uint256).max);
adapter.swap(
pair, address(address(0)), address(eEth_), OrderSide.Buy, limits[0]
pair,
address(address(0)),
address(eEth_),
OrderSide.Buy,
limits[0]
);
eEth_.approve(address(adapter), type(uint256).max);
@@ -78,7 +83,11 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
/// work(balance is shares)
deal(address(adapter), type(uint128).max);
adapter.swap(
pair, address(address(0)), address(eEth_), OrderSide.Buy, specifiedAmount
pair,
address(address(0)),
address(eEth_),
OrderSide.Buy,
specifiedAmount
);
eEth_.approve(address(adapter), specifiedAmount);
@@ -87,8 +96,9 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
uint256 eEth_balance = eEth_.balanceOf(address(this));
uint256 weEth_balance = weEth_.balanceOf(address(this));
Trade memory trade =
adapter.swap(pair, address(eEth_), address(weEth_), side, specifiedAmount);
Trade memory trade = adapter.swap(
pair, address(eEth_), address(weEth_), side, specifiedAmount
);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -140,7 +150,8 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
IERC20 weEth_ = IERC20(address(weEth));
uint256 weEth_bal_before = weEth_.balanceOf(address(this));
bytes32 pair = bytes32(0);
uint256[] memory limits = adapter.getLimits(pair, address(weEth_), address(eEth_));
uint256[] memory limits =
adapter.getLimits(pair, address(weEth_), address(eEth_));
if (side == OrderSide.Buy) {
vm.assume(specifiedAmount < limits[1] && specifiedAmount > 100);
@@ -149,7 +160,11 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
/// work(balance is shares)
deal(address(adapter), type(uint256).max);
adapter.swap(
pair, address(address(0)), address(weEth_), OrderSide.Buy, limits[0]
pair,
address(address(0)),
address(weEth_),
OrderSide.Buy,
limits[0]
);
weEth_.approve(address(adapter), type(uint256).max);
@@ -160,7 +175,11 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
/// work(balance is shares)
deal(address(adapter), type(uint128).max);
adapter.swap(
pair, address(address(0)), address(weEth_), OrderSide.Buy, specifiedAmount
pair,
address(address(0)),
address(weEth_),
OrderSide.Buy,
specifiedAmount
);
weEth_.approve(address(adapter), specifiedAmount);
@@ -174,8 +193,9 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
/// therefore we use weEth_balance - weEth_bal_before as specifiedAmount
uint256 realAmountWeEth_ = weEth_balance - weEth_bal_before;
Trade memory trade =
adapter.swap(pair, address(weEth_), address(eEth_), side, realAmountWeEth_);
Trade memory trade = adapter.swap(
pair, address(weEth_), address(eEth_), side, realAmountWeEth_
);
if (trade.calculatedAmount > 0) {
if (side == OrderSide.Buy) {
@@ -386,9 +406,8 @@ contract EtherfiAdapterTest is Test, ISwapAdapterTypes {
function testGetLimitsEtherfi() public {
bytes32 pair = bytes32(0);
uint256[] memory limits = adapter.getLimits(
pair, address(eEth), address(weEth)
);
uint256[] memory limits =
adapter.getLimits(pair, address(eEth), address(weEth));
assertEq(limits.length, 2);
}