From adbe5511b5d3cb2b799e08e49dd1d7f130ea1c73 Mon Sep 17 00:00:00 2001 From: "A.L." Date: Sat, 7 Dec 2024 15:52:59 +0800 Subject: [PATCH] fix: addresses #9 --- src/libraries/RoutesLib.sol | 4 ++-- test/unit/libraries/RoutesLib.t.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/RoutesLib.sol b/src/libraries/RoutesLib.sol index cc8bbf8..6daa8fe 100644 --- a/src/libraries/RoutesLib.sol +++ b/src/libraries/RoutesLib.sol @@ -28,8 +28,8 @@ library RoutesLib { } // Assumes that aDecimalDifference is between -18 and 18 - // Assumes that aPrice is between 1 and 1e36 - // Assumes that aRewardThreshold is <= Constants.BP_SCALE + // Assumes that aPrice is between 1 and `Constants.MAX_SUPPORTED_PRICE` + // Assumes that aRewardThreshold is <= `Constants.BP_SCALE` function packSimplePrice(int256 aDecimalDifference, uint256 aPrice, uint256 aRewardThreshold) internal pure diff --git a/test/unit/libraries/RoutesLib.t.sol b/test/unit/libraries/RoutesLib.t.sol index df0540c..05a6e32 100644 --- a/test/unit/libraries/RoutesLib.t.sol +++ b/test/unit/libraries/RoutesLib.t.sol @@ -38,7 +38,7 @@ contract RoutesLibTest is Test { function testPackSimplePrice(int8 aDiff, uint256 aPrice) external pure { // assume - uint256 lPrice = bound(aPrice, 1, 1e36); + uint256 lPrice = bound(aPrice, 1, Constants.MAX_SUPPORTED_PRICE); // act bytes32 lResult = int256(aDiff).packSimplePrice(lPrice, Constants.BP_SCALE);