Skip to content

Commit

Permalink
✨ prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
Flocqst committed Oct 11, 2024
1 parent 5fa14a7 commit e6db3ac
Showing 1 changed file with 79 additions and 79 deletions.
158 changes: 79 additions & 79 deletions test/AsyncOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,83 +28,83 @@ contract AsyncOrderTest is Bootstrap, SynthetixMock {
/// @custom:todo rewrite commented tests with hardhat
/// cause : InvalidFEOpcode when calling getPricesInWei on Arbitrum
contract CommitOrder is AsyncOrderTest {
// function test_commitOrder() public {
// vm.prank(ACTOR);

// (IPerpsMarketProxy.Data memory retOrder, uint256 fees) = engine
// .commitOrder({
// _perpsMarketId: SETH_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// });

// assertTrue(retOrder.settlementTime != 0);
// assertTrue(retOrder.request.marketId == SETH_PERPS_MARKET_ID);
// assertTrue(retOrder.request.accountId == accountId);
// assertTrue(retOrder.request.sizeDelta == SIZE_DELTA);
// assertTrue(
// retOrder.request.settlementStrategyId == SETTLEMENT_STRATEGY_ID
// );
// assertTrue(retOrder.request.acceptablePrice == ACCEPTABLE_PRICE_LONG);
// assertTrue(retOrder.request.trackingCode == TRACKING_CODE);
// assertTrue(retOrder.request.referrer == REFERRER);

// assertTrue(fees != 0);
// }

// function test_commitOrder_invalid_market() public {
// vm.prank(ACTOR);

// vm.expectRevert(
// abi.encodeWithSelector(
// InvalidMarket.selector, INVALID_PERPS_MARKET_ID
// )
// );

// engine.commitOrder({
// _perpsMarketId: INVALID_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// });
// }

// function test_commitOrder_insufficient_collateral() public {
// vm.prank(ACTOR);

// try engine.commitOrder({
// _perpsMarketId: SETH_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA * SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// }) {} catch (bytes memory reason) {
// assertEq(bytes4(reason), InsufficientMargin.selector);
// }
// }

// function test_commitOrder_Unauthorized() public {
// vm.prank(BAD_ACTOR);

// vm.expectRevert(abi.encodeWithSelector(IEngine.Unauthorized.selector));

// engine.commitOrder({
// _perpsMarketId: SETH_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// });
// }
// function test_commitOrder() public {
// vm.prank(ACTOR);

// (IPerpsMarketProxy.Data memory retOrder, uint256 fees) = engine
// .commitOrder({
// _perpsMarketId: SETH_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// });

// assertTrue(retOrder.settlementTime != 0);
// assertTrue(retOrder.request.marketId == SETH_PERPS_MARKET_ID);
// assertTrue(retOrder.request.accountId == accountId);
// assertTrue(retOrder.request.sizeDelta == SIZE_DELTA);
// assertTrue(
// retOrder.request.settlementStrategyId == SETTLEMENT_STRATEGY_ID
// );
// assertTrue(retOrder.request.acceptablePrice == ACCEPTABLE_PRICE_LONG);
// assertTrue(retOrder.request.trackingCode == TRACKING_CODE);
// assertTrue(retOrder.request.referrer == REFERRER);

// assertTrue(fees != 0);
// }

// function test_commitOrder_invalid_market() public {
// vm.prank(ACTOR);

// vm.expectRevert(
// abi.encodeWithSelector(
// InvalidMarket.selector, INVALID_PERPS_MARKET_ID
// )
// );

// engine.commitOrder({
// _perpsMarketId: INVALID_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// });
// }

// function test_commitOrder_insufficient_collateral() public {
// vm.prank(ACTOR);

// try engine.commitOrder({
// _perpsMarketId: SETH_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA * SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// }) {} catch (bytes memory reason) {
// assertEq(bytes4(reason), InsufficientMargin.selector);
// }
// }

// function test_commitOrder_Unauthorized() public {
// vm.prank(BAD_ACTOR);

// vm.expectRevert(abi.encodeWithSelector(IEngine.Unauthorized.selector));

// engine.commitOrder({
// _perpsMarketId: SETH_PERPS_MARKET_ID,
// _accountId: accountId,
// _sizeDelta: SIZE_DELTA,
// _settlementStrategyId: SETTLEMENT_STRATEGY_ID,
// _acceptablePrice: ACCEPTABLE_PRICE_LONG,
// _trackingCode: TRACKING_CODE,
// _referrer: REFERRER
// });
// }
}

0 comments on commit e6db3ac

Please sign in to comment.