Closed tanliwei closed 2 years ago
There are callings to the getLiquidityForAmount1
function and the getLiquidityForAmount0
function in the testing contract LiquidityAmountsTest
. However, it is still ok.
it is closed since it turns out this pr does not raise the interest of anyone.
The two internal functions,
getLiquidityForAmount0
andgetLiquidityForAmount1
, are only called in the belowgetLiquidityForAmounts
function. https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/LiquidityAmounts.sol#L56-L75The
if-else
branch of thegetLiquidityForAmounts
function already done the validation of the parameters passed into thegetLiquidityForAmount0
function andgetLiquidityForAmount1
function. I.e., make the first parameter passed into thegetLiquidityForAmount0
function less than the second parameter. Same validation done to the parameter passed into thegetLiquidityForAmount1
function.So, there is no need to repeatedly do the same validations in the
getLiquidityForAmount0
function and thegetLiquidityForAmount1
function.