Skip to content

Commit

Permalink
test: add revert check when maxDeltaY is reached in G3M strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Feb 23, 2024
1 parent ee8dc25 commit 0d3c003
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/unit/strategies/G3M/Allocate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ contract G3MAllocateTest is G3MSetUp {
dfmm.allocate(POOL_ID, data);
}

function test_G3M_allocate_RevertsIfMoreThanMaxDeltaY() public init {
uint256 maxDeltaX = 0.1 ether;

(uint256 maxDeltaY, uint256 deltaLiquidity) =
solver.allocateGivenDeltaX(POOL_ID, maxDeltaX);

bytes memory data = abi.encode(maxDeltaX, maxDeltaY - 1, deltaLiquidity);
vm.expectRevert();
dfmm.allocate(POOL_ID, data);
}

function test_G3M_allocate_GivenY() public init {
uint256 maxDeltaY = 0.1 ether;

Expand Down

0 comments on commit 0d3c003

Please sign in to comment.