From 45186b70ec446a42736dd99b947463b1e1569b59 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 13 Jun 2018 16:14:48 +0200 Subject: Move orderFill combinatorialTests to exchange folder --- packages/contracts/test/combinatorial_tests.ts | 48 ---------------------- .../contracts/test/exchange/combinatorial_tests.ts | 48 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 packages/contracts/test/combinatorial_tests.ts create mode 100644 packages/contracts/test/exchange/combinatorial_tests.ts (limited to 'packages') diff --git a/packages/contracts/test/combinatorial_tests.ts b/packages/contracts/test/combinatorial_tests.ts deleted file mode 100644 index c7de8d7e3..000000000 --- a/packages/contracts/test/combinatorial_tests.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import * as _ from 'lodash'; - -import { chaiSetup } from '../src/utils/chai_setup'; -import { CoreCombinatorialUtils, coreCombinatorialUtilsFactoryAsync } from '../src/utils/core_combinatorial_utils'; -import { provider, txDefaults, web3Wrapper } from '../src/utils/web3_wrapper'; - -import { OrderScenario } from '../src/utils/types'; - -chaiSetup.configure(); -const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); - -describe('Combinatorial tests', () => { - let coreCombinatorialUtils: CoreCombinatorialUtils; - - before(async () => { - await blockchainLifecycle.startAsync(); - coreCombinatorialUtils = await coreCombinatorialUtilsFactoryAsync(web3Wrapper, txDefaults); - }); - after(async () => { - await blockchainLifecycle.revertAsync(); - }); - beforeEach(async () => { - await blockchainLifecycle.startAsync(); - }); - afterEach(async () => { - await blockchainLifecycle.revertAsync(); - }); - const test = (orderScenarios: OrderScenario[]) => { - _.forEach(orderScenarios, orderScenario => { - const description = `Combinatorial OrderFill: ${orderScenario.feeRecipientScenario} ${ - orderScenario.makerAssetAmountScenario - } ${orderScenario.takerAssetAmountScenario} ${orderScenario.makerFeeScenario} ${ - orderScenario.takerFeeScenario - } ${orderScenario.expirationTimeSecondsScenario} ${orderScenario.makerAssetDataScenario} ${ - orderScenario.takerAssetDataScenario - }`; - it(description, async () => { - const order = coreCombinatorialUtils.orderFactory.generateOrder(orderScenario); - await coreCombinatorialUtils.testFillOrderScenarioAsync(order, provider); - }); - }); - }; - - const allOrderScenarios = CoreCombinatorialUtils.generateOrderCombinations(); - - describe.only('Fills orders', () => test(allOrderScenarios)); -}); diff --git a/packages/contracts/test/exchange/combinatorial_tests.ts b/packages/contracts/test/exchange/combinatorial_tests.ts new file mode 100644 index 000000000..2870a22ed --- /dev/null +++ b/packages/contracts/test/exchange/combinatorial_tests.ts @@ -0,0 +1,48 @@ +import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import * as _ from 'lodash'; + +import { chaiSetup } from '../../src/utils/chai_setup'; +import { CoreCombinatorialUtils, coreCombinatorialUtilsFactoryAsync } from '../../src/utils/core_combinatorial_utils'; +import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; + +import { OrderScenario } from '../../src/utils/types'; + +chaiSetup.configure(); +const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); + +describe('Combinatorial tests', () => { + let coreCombinatorialUtils: CoreCombinatorialUtils; + + before(async () => { + await blockchainLifecycle.startAsync(); + coreCombinatorialUtils = await coreCombinatorialUtilsFactoryAsync(web3Wrapper, txDefaults); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); + beforeEach(async () => { + await blockchainLifecycle.startAsync(); + }); + afterEach(async () => { + await blockchainLifecycle.revertAsync(); + }); + const test = (orderScenarios: OrderScenario[]) => { + _.forEach(orderScenarios, orderScenario => { + const description = `Combinatorial OrderFill: ${orderScenario.feeRecipientScenario} ${ + orderScenario.makerAssetAmountScenario + } ${orderScenario.takerAssetAmountScenario} ${orderScenario.makerFeeScenario} ${ + orderScenario.takerFeeScenario + } ${orderScenario.expirationTimeSecondsScenario} ${orderScenario.makerAssetDataScenario} ${ + orderScenario.takerAssetDataScenario + }`; + it(description, async () => { + const order = coreCombinatorialUtils.orderFactory.generateOrder(orderScenario); + await coreCombinatorialUtils.testFillOrderScenarioAsync(order, provider); + }); + }); + }; + + const allOrderScenarios = CoreCombinatorialUtils.generateOrderCombinations(); + + describe.only('Fills orders', () => test(allOrderScenarios)); +}); -- cgit v1.2.3