aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 19:36:21 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 19:36:21 +0800
commitefbd81df0273a2b29b072b737bd04c4b3c065913 (patch)
tree1a332a8d81bd79376c9d90cbdc83fb07a367550b /test
parent426f43391e0b762f03eb2aaf11e0a8d6c6aab301 (diff)
downloaddexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.tar
dexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.tar.gz
dexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.tar.bz2
dexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.tar.lz
dexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.tar.xz
dexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.tar.zst
dexon-sol-tools-efbd81df0273a2b29b072b737bd04c4b3c065913.zip
Move fillableAmount to initialization section
Diffstat (limited to 'test')
-rw-r--r--test/exchange_wrapper_test.ts25
1 files changed, 17 insertions, 8 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index 21d54e061..43f8683c8 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -127,6 +127,7 @@ describe('ExchangeWrapper', () => {
let makerAddress: string;
let takerAddress: string;
let feeRecipient: string;
+ const fillableAmount = new BigNumber(5);
const fillTakerAmount = new BigNumber(5);
const shouldCheckTransfer = false;
before(async () => {
@@ -139,7 +140,6 @@ describe('ExchangeWrapper', () => {
describe('#fillOrderAsync', () => {
describe('failed fills', () => {
it('should throw when the fill amount is zero', async () => {
- const fillableAmount = new BigNumber(5);
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
@@ -149,7 +149,6 @@ describe('ExchangeWrapper', () => {
)).to.be.rejectedWith(ExchangeContractErrs.ORDER_REMAINING_FILL_AMOUNT_ZERO);
});
it('should throw when sender is not a taker', async () => {
- const fillableAmount = new BigNumber(5);
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
@@ -160,7 +159,6 @@ describe('ExchangeWrapper', () => {
});
it('should throw when order is expired', async () => {
const expirationInPast = new BigNumber(1496826058); // 7th Jun 2017
- const fillableAmount = new BigNumber(5);
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress,
fillableAmount, expirationInPast,
@@ -170,7 +168,6 @@ describe('ExchangeWrapper', () => {
)).to.be.rejectedWith(ExchangeContractErrs.ORDER_FILL_EXPIRED);
});
describe('should throw when not enough balance or allowance to fulfill the order', () => {
- const fillableAmount = new BigNumber(5);
const balanceToSubtractFromMaker = new BigNumber(3);
const lackingAllowance = new BigNumber(3);
let signedOrder: SignedOrder;
@@ -225,7 +222,6 @@ describe('ExchangeWrapper', () => {
)).to.be.rejectedWith(ExchangeContractErrs.ORDER_FILL_ROUNDING_ERROR);
});
describe('should throw when not enough balance or allowance to pay fees', () => {
- const fillableAmount = new BigNumber(5);
const makerFee = new BigNumber(2);
const takerFee = new BigNumber(2);
let signedOrder: SignedOrder;
@@ -273,7 +269,6 @@ describe('ExchangeWrapper', () => {
});
describe('successful fills', () => {
it('should fill a valid order', async () => {
- const fillableAmount = new BigNumber(5);
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
@@ -297,7 +292,6 @@ describe('ExchangeWrapper', () => {
.to.be.bignumber.equal(fillableAmount.minus(fillTakerAmount));
});
it('should partially fill the valid order', async () => {
- const fillableAmount = new BigNumber(5);
const signedOrder = await fillScenarios.createFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
);
@@ -314,7 +308,6 @@ describe('ExchangeWrapper', () => {
.to.be.bignumber.equal(fillableAmount.minus(partialFillAmount));
});
it('should fill the valid orders with fees', async () => {
- const fillableAmount = new BigNumber(5);
const makerFee = new BigNumber(1);
const takerFee = new BigNumber(2);
const signedOrder = await fillScenarios.createFillableSignedOrderWithFeesAsync(
@@ -328,6 +321,22 @@ describe('ExchangeWrapper', () => {
});
});
});
+ describe('#batchFillOrderAsync', () => {
+ let anotherSignedOrder: SignedOrder;
+ let anotherOrderHashHex: string;
+ beforeEach(async () => {
+ anotherSignedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount,
+ );
+ anotherOrderHashHex = await zeroEx.getOrderHashHexAsync(anotherSignedOrder);
+ });
+ describe('failed batch fills', () => {
+
+ });
+ describe('successful batch fills', () => {
+
+ });
+ });
});
describe('cancel order(s)', () => {
let makerTokenAddress: string;