Skip to content

Commit

Permalink
test: fuzzing all cases below threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Aug 8, 2024
1 parent d0a04d8 commit d2f700a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 76 deletions.
4 changes: 2 additions & 2 deletions src/libraries/RoutesLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ library RoutesLib {
rPrice = uint256(aData & 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
}

function getRewardThreshold(bytes32 aData) internal pure returns (uint16 rBpDiffForMaxReward) {
rBpDiffForMaxReward =
function getRewardThreshold(bytes32 aData) internal pure returns (uint16 rRewardThreshold) {
rRewardThreshold =
uint16(uint256((aData & 0x0000ffff00000000000000000000000000000000000000000000000000000000) >> 224));
}

Expand Down
5 changes: 4 additions & 1 deletion test/__fixtures/BaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ import { ReservoirPriceOracle, PriceType, IPriceOracle } from "src/ReservoirPric
contract BaseTest is Test {
using FactoryStoreLib for GenericFactory;

uint64 internal constant DEFAULT_REWARD_GAS_AMOUNT = 200_000;

GenericFactory internal _factory = new GenericFactory();
ReservoirPair internal _pair;

ReservoirPriceOracle internal _oracle = new ReservoirPriceOracle(0.15 minutes, 500_000, PriceType.CLAMPED_PRICE);
ReservoirPriceOracle internal _oracle =
new ReservoirPriceOracle(0.15 minutes, DEFAULT_REWARD_GAS_AMOUNT, PriceType.CLAMPED_PRICE);

MintableERC20 internal _tokenA = MintableERC20(address(0x100));
MintableERC20 internal _tokenB = MintableERC20(address(0x200));
Expand Down
Loading

0 comments on commit d2f700a

Please sign in to comment.