Skip to content

Commit bafb73a

Browse files
committed
test: fix func visibility and unused vars
1 parent 7534d4e commit bafb73a

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

test/TestPortfolioAllocate.t.sol

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ contract TestPortfolioAllocate is Setup {
493493
uint128 amount = 0.1 ether;
494494
uint64 xid = ghost().poolId;
495495

496-
(uint256 amount0, uint256 amount1) =
496+
(uint256 amount0,) =
497497
subject().getLiquidityDeltas(ghost().poolId, int128(amount));
498498
uint256 fee0 = amount0 * 1 / 100;
499499
// uint256 fee1 = amount1 * 1 / 100;
@@ -749,11 +749,9 @@ contract TestPortfolioAllocate is Setup {
749749

750750
bytes[] memory res = subject().multicall(data);
751751

752-
(uint256 assetDeallocate, uint256 quoteDeallocate) =
753-
abi.decode(res[0], (uint256, uint256));
752+
(uint256 assetDeallocate,) = abi.decode(res[0], (uint256, uint256));
754753

755-
(uint256 assetAllocate, uint256 quoteAllocate) =
756-
abi.decode(res[1], (uint256, uint256));
754+
(uint256 assetAllocate,) = abi.decode(res[1], (uint256, uint256));
757755

758756
uint256 postAssetBalance =
759757
ghost().asset().to_token().balanceOf(address(actor()));

test/TestPortfolioInvariant.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ contract TestPortfolioInvariant is Setup {
6969
inverseCdfQuotient - inverseCdfDifference + int256(volSqrtYearsWad);
7070
}
7171

72-
function test_trading_function() public {
72+
function test_trading_function() public view {
7373
uint256 reserveXPerWad = 0.308537538726 ether;
7474
uint256 reserveYPerWad = 0.308537538726 ether;
7575
uint256 strikePriceWad = 1 ether;
@@ -89,7 +89,7 @@ contract TestPortfolioInvariant is Setup {
8989

9090
/// Sanity check console log. Returns an invariant close to 0.
9191
/// The result is about 1e-7.
92-
function test_invariant_initial() public {
92+
function test_invariant_initial() public view {
9393
uint256 reserveXPerWad = 0.308537538726 ether;
9494
uint256 reserveYPerWad = 0.308537538726 ether;
9595
uint256 strikePriceWad = 1 ether;
@@ -442,7 +442,7 @@ contract TestPortfolioInvariant is Setup {
442442
uint256 strikePriceWad,
443443
uint256 volatilityWad,
444444
uint256 timeRemainingSec
445-
) internal returns (uint256, uint256, uint256, uint256, uint256) {
445+
) internal view returns (uint256, uint256, uint256, uint256, uint256) {
446446
// Need to make sure to bound the arguments to values that will be used.
447447
// min x + min delta <= x <= max - delta + min x - 1
448448
reserveXPerWad = bound(
@@ -510,7 +510,7 @@ contract TestPortfolioInvariant is Setup {
510510
uint256 timeRemainingSec,
511511
int256 previousResult,
512512
int256 result
513-
) internal {
513+
) internal view {
514514
uint256 postReserve = applyDeltaToX
515515
? uint256(int256(reserveXPerWad) + delta)
516516
: uint256(int256(reserveYPerWad) + delta);

0 commit comments

Comments
 (0)