Skip to content

Commit 9480014

Browse files
committed
test: add invariant_NoPriceChangesBeforeStart invariant check
1 parent 39121a6 commit 9480014

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/invariant/DopplerInvariants.sol

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ contract DopplerInvariantsTest is BaseTest {
5050
console.log("+-------------------+-----------------------+");
5151
console.log("| Function Name | Calls |", handler.totalCalls());
5252
console.log("+-------------------+-----------------------+");
53-
console.log("| buyExactAmountIn |", handler.calls(handler.buyExactAmountIn.selector), " |");
54-
console.log("| buyExactAmountOut |", handler.calls(handler.buyExactAmountOut.selector), " |");
53+
console.log("| buyExactAmountIn |", handler.calls(handler.buyExactAmountIn.selector), " |");
54+
console.log("| buyExactAmountOut |", handler.calls(handler.buyExactAmountOut.selector), " |");
5555
console.log("| sellExactIn |", handler.calls(handler.sellExactIn.selector), " |");
5656
console.log("| sellExactOut |", handler.calls(handler.sellExactOut.selector), " |");
5757
console.log("+-------------------+-----------------------+");
@@ -121,4 +121,9 @@ contract DopplerInvariantsTest is BaseTest {
121121
if (liquidity > 0) assertTrue(tickLower != tickUpper);
122122
}
123123
}
124+
125+
function invariant_NoPriceChangesBeforeStart() public {
126+
vm.warp(DEFAULT_STARTING_TIME - 1);
127+
assertEq(hook.getCurrentTick(poolId), DEFAULT_START_TICK);
128+
}
124129
}

0 commit comments

Comments
 (0)