From 8798fc7313cb9873d30616a354f8aa37e0368fbc Mon Sep 17 00:00:00 2001 From: domenicodev Date: Mon, 8 Jan 2024 16:48:07 +0100 Subject: [PATCH] fix: Removed internal _getLimits --- evm/src/integral/IntegralSwapAdapter.sol | 29 ++++++++++-------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/evm/src/integral/IntegralSwapAdapter.sol b/evm/src/integral/IntegralSwapAdapter.sol index 8af8487..3d7a887 100644 --- a/evm/src/integral/IntegralSwapAdapter.sol +++ b/evm/src/integral/IntegralSwapAdapter.sol @@ -70,7 +70,18 @@ contract IntegralSwapAdapter is ISwapAdapter { override 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 @@ -179,22 +190,6 @@ contract IntegralSwapAdapter is ISwapAdapter { 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 /// @param sellToken token to sell /// @param buyToken token to buy