aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-14 16:40:17 +0800
committerFabio Berger <me@fabioberger.com>2018-06-14 16:40:17 +0800
commit98405a39dbb870c1eb9f562afca4539602917c67 (patch)
tree8556a18de4ae3a5902c6a428a1dc741920c2531a /packages/contracts/test
parent6239686afaf733707ad0c4687c535969c2d53205 (diff)
downloaddexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.tar
dexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.tar.gz
dexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.tar.bz2
dexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.tar.lz
dexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.tar.xz
dexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.tar.zst
dexon-sol-tools-98405a39dbb870c1eb9f562afca4539602917c67.zip
Add ability to specify takerAssetFillAmount and taker scenarios as part of a FillScenario
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/exchange/combinatorial_tests.ts18
1 files changed, 12 insertions, 6 deletions
diff --git a/packages/contracts/test/exchange/combinatorial_tests.ts b/packages/contracts/test/exchange/combinatorial_tests.ts
index 2870a22ed..fd9193d69 100644
--- a/packages/contracts/test/exchange/combinatorial_tests.ts
+++ b/packages/contracts/test/exchange/combinatorial_tests.ts
@@ -5,7 +5,7 @@ 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';
+import { FillScenario, OrderScenario, TakerAssetFillAmountScenario } from '../../src/utils/types';
chaiSetup.configure();
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
@@ -26,8 +26,9 @@ describe('Combinatorial tests', () => {
afterEach(async () => {
await blockchainLifecycle.revertAsync();
});
- const test = (orderScenarios: OrderScenario[]) => {
- _.forEach(orderScenarios, orderScenario => {
+ const test = (fillScenarios: FillScenario[]) => {
+ _.forEach(fillScenarios, fillScenario => {
+ const orderScenario = fillScenario.orderScenario;
const description = `Combinatorial OrderFill: ${orderScenario.feeRecipientScenario} ${
orderScenario.makerAssetAmountScenario
} ${orderScenario.takerAssetAmountScenario} ${orderScenario.makerFeeScenario} ${
@@ -36,13 +37,18 @@ describe('Combinatorial tests', () => {
orderScenario.takerAssetDataScenario
}`;
it(description, async () => {
- const order = coreCombinatorialUtils.orderFactory.generateOrder(orderScenario);
- await coreCombinatorialUtils.testFillOrderScenarioAsync(order, provider);
+ await coreCombinatorialUtils.testFillOrderScenarioAsync(provider, fillScenario);
});
});
};
const allOrderScenarios = CoreCombinatorialUtils.generateOrderCombinations();
+ const allFillScenarios = _.map(allOrderScenarios, orderScenario => {
+ return {
+ orderScenario,
+ takerAssetFillAmountScenario: TakerAssetFillAmountScenario.LessThanRemainingFillableTakerAssetAmount,
+ };
+ });
- describe.only('Fills orders', () => test(allOrderScenarios));
+ describe('Fills orders', () => test(allFillScenarios));
});