Skip to content

Commit

Permalink
cleaned up test
Browse files Browse the repository at this point in the history
  • Loading branch information
theSchein committed Sep 16, 2024
1 parent f8ee58c commit e54bb13
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions test/TWAMM.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,39 +105,7 @@ contract TWAMMTest is Test, Deployers, GasSnapshot {
assertEq(twamm.lastVirtualOrderTimestamp(initId), 10000);
}

// @note need to figure out what snapStart is.
// When it is comment out it is panicing for an arithmetic underflow or overflow.
// function testTWAMM_submitOrder_StoresOrderWithCorrectPoolAndOrderPoolInfo() public {
// uint160 expiration = 30000;
// uint160 submitTimestamp = 10000;
// uint160 duration = expiration - submitTimestamp;

// ITWAMM.OrderKey memory orderKey = ITWAMM.OrderKey(address(this), expiration, true);

// ITWAMM.Order memory nullOrder = twamm.getOrder(poolKey, orderKey);
// assertEq(nullOrder.sellRate, 0);
// assertEq(nullOrder.earningsFactorLast, 0);

// vm.warp(10000);
// token0.approve(address(twamm), 100 ether);
// // @note snapStart("TWAMMSubmitOrder");
// twamm.submitOrder(poolKey, orderKey, 1 ether);
// snapEnd();

// ITWAMM.Order memory submittedOrder = twamm.getOrder(poolKey, orderKey);
// (uint256 sellRateCurrent0For1, uint256 earningsFactorCurrent0For1) = twamm.getOrderPool(poolKey, true);
// (uint256 sellRateCurrent1For0, uint256 earningsFactorCurrent1For0) = twamm.getOrderPool(poolKey, false);

// assertEq(submittedOrder.sellRate, 1 ether / duration);
// assertEq(submittedOrder.earningsFactorLast, 0);
// assertEq(sellRateCurrent0For1, 1 ether / duration);
// assertEq(sellRateCurrent1For0, 0);
// assertEq(earningsFactorCurrent0For1, 0);
// assertEq(earningsFactorCurrent1For0, 0);
// }

function TWAMMSingleSell0For1SellRateAndEarningsFactorGetsUpdatedProperly() public {
// TODO: fails with a bug for single pool sell, swap amount 3 wei above balance.

ITWAMM.OrderKey memory orderKey1 = ITWAMM.OrderKey(address(this), 30000, true);
ITWAMM.OrderKey memory orderKey2 = ITWAMM.OrderKey(address(this), 40000, true);
Expand Down

0 comments on commit e54bb13

Please sign in to comment.