infrastructure-upgrade/lib/v3-core/contracts/test/LiquidityMathTest.sol

17 lines
478 B
Solidity
Raw Permalink Normal View History

2023-04-08 18:46:18 +00:00
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;
import '../libraries/LiquidityMath.sol';
contract LiquidityMathTest {
function addDelta(uint128 x, int128 y) external pure returns (uint128 z) {
return LiquidityMath.addDelta(x, y);
}
function getGasCostOfAddDelta(uint128 x, int128 y) external view returns (uint256) {
uint256 gasBefore = gasleft();
LiquidityMath.addDelta(x, y);
return gasBefore - gasleft();
}
}