Skip to content

Commit

Permalink
test: update LogNormal getPrice tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Apr 25, 2024
1 parent f5eb6b3 commit 30b2b2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/LogNormal/unit/Allocate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ contract LogNormalAllocateTest is LogNormalSetUp {
}

function test_LogNormal_allocate_x_maintains_price() public init {
uint256 startPrice = solver.getPrice(POOL_ID);
uint256 startPrice = solver.getPrice(POOL_ID, 0, 1);
uint256 deltaX = 0.77 ether;

(uint256[] memory reserves, uint256 liquidity) =
Expand All @@ -114,14 +114,14 @@ contract LogNormalAllocateTest is LogNormalSetUp {
bytes memory data = abi.encode(deltaX, deltaYMax, deltaLiquidity);
dfmm.allocate(POOL_ID, data);

uint256 endPrice = solver.getPrice(POOL_ID);
uint256 endPrice = solver.getPrice(POOL_ID, 0, 1);

assertEq(startPrice, endPrice);
}

function test_LogNormal_allocate_y_maintains_price() public init {
uint256 maxDeltaY = 0.77 ether;
uint256 startPrice = solver.getPrice(POOL_ID);
uint256 startPrice = solver.getPrice(POOL_ID, 0, 1);

(uint256[] memory reserves, uint256 liquidity) =
solver.getReservesAndLiquidity(POOL_ID);
Expand All @@ -133,7 +133,7 @@ contract LogNormalAllocateTest is LogNormalSetUp {

bytes memory data = abi.encode(maxDeltaX, maxDeltaY, deltaLiquidity);
dfmm.allocate(POOL_ID, data);
uint256 endPrice = solver.getPrice(POOL_ID);
uint256 endPrice = solver.getPrice(POOL_ID, 0, 1);

assertEq(startPrice, endPrice);
}
Expand Down

0 comments on commit 30b2b2a

Please sign in to comment.