Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
hensha256 committed Aug 2, 2024
1 parent 1c2538d commit 724b509
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/libraries/BipsLibrary.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ contract PositionConfigTest is Test {

function test_fuzz_calculatePortion(uint256 amount, uint256 bips) public {
amount = bound(amount, 0, uint256(type(uint128).max));
if (bips > 10000) {
if (bips > BipsLibrary.BIPS_BASE) {
vm.expectRevert(BipsLibrary.InvalidBips.selector);
amount.calculatePortion(bips);
} else {
assertEq(amount.calculatePortion(bips), amount * bips / 10000);
assertEq(amount.calculatePortion(bips), amount * bips / BipsLibrary.BIPS_BASE);
}
}
}
4 changes: 2 additions & 2 deletions test/router/Payments.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ contract PaymentsTests is RoutingTestHelpers, GasSnapshot {
uint256 outputBalanceAfter = key0.currency1.balanceOfSelf();
uint256 bobBalanceAfter = key0.currency1.balanceOf(bob);

uint256 expectedFee = expectedAmountOut * 15 / 10000;
uint256 expectedFee = expectedAmountOut * 15 / BipsLibrary.BIPS_BASE;

// router is empty
assertEq(currency0.balanceOf(address(router)), 0);
Expand All @@ -131,7 +131,7 @@ contract PaymentsTests is RoutingTestHelpers, GasSnapshot {
plan = plan.add(Actions.SWAP_EXACT_IN_SINGLE, abi.encode(params));
plan = plan.add(Actions.SETTLE_ALL, abi.encode(key0.currency0));
// bips is larger than maximum bips
plan = plan.add(Actions.TAKE_PORTION, abi.encode(key0.currency1, bob, 10001));
plan = plan.add(Actions.TAKE_PORTION, abi.encode(key0.currency1, bob, BipsLibrary.BIPS_BASE + 1));
plan = plan.add(Actions.TAKE_ALL, abi.encode(key0.currency1, address(this)));

bytes memory data = plan.encode();
Expand Down

0 comments on commit 724b509

Please sign in to comment.