fix: Removed internal _getLimits

This commit is contained in:
domenicodev
2024-01-08 16:48:07 +01:00
parent af7b9cd9a6
commit 8798fc7313

View File

@@ -70,7 +70,18 @@ contract IntegralSwapAdapter is ISwapAdapter {
override override
returns (uint256[] memory limits) returns (uint256[] memory limits)
{ {
return _getLimits(poolId, sellToken, buyToken); (
,
,
,
uint256 limitMax0,
,
uint256 limitMax1
) = relayer.getPoolState(address(sellToken), address(buyToken));
limits = new uint256[](2);
limits[0] = limitMax0;
limits[1] = limitMax1;
} }
/// @inheritdoc ISwapAdapter /// @inheritdoc ISwapAdapter
@@ -179,22 +190,6 @@ contract IntegralSwapAdapter is ISwapAdapter {
return amountIn; return amountIn;
} }
/// @notice Internal counterpart of _getLimits
function _getLimits(bytes32 poolId, IERC20 sellToken, IERC20 buyToken) internal view returns (uint256[] memory limits) {
(
uint256 price_,
uint256 fee,
,
uint256 limitMax0,
,
uint256 limitMax1
) = relayer.getPoolState(address(sellToken), address(buyToken));
limits = new uint256[](2);
limits[0] = limitMax0;
limits[1] = limitMax1;
}
/// @notice Get swap price including fee /// @notice Get swap price including fee
/// @param sellToken token to sell /// @param sellToken token to sell
/// @param buyToken token to buy /// @param buyToken token to buy