aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-10 04:02:28 +0800
committerFabio Berger <me@fabioberger.com>2017-11-10 04:02:28 +0800
commit9ff42053c3f145ab6d5486d62325ed222363a8c5 (patch)
treef76517056ccbb94317389ee042662eb64bc229b8 /test
parent5623400557232b974e11e786cf6bfa49128a04e2 (diff)
downloaddexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.tar
dexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.tar.gz
dexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.tar.bz2
dexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.tar.lz
dexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.tar.xz
dexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.tar.zst
dexon-sol-tools-9ff42053c3f145ab6d5486d62325ed222363a8c5.zip
Add numConfirmations arg so that caller can decide on numConfirmations at which they want to watch orders
Diffstat (limited to 'test')
-rw-r--r--test/order_state_watcher_test.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/order_state_watcher_test.ts b/test/order_state_watcher_test.ts
index f1b027c40..9d0e1a625 100644
--- a/test/order_state_watcher_test.ts
+++ b/test/order_state_watcher_test.ts
@@ -41,6 +41,7 @@ describe('OrderStateWatcher', () => {
let web3Wrapper: Web3Wrapper;
let signedOrder: SignedOrder;
const fillableAmount = new BigNumber(5);
+ const numConfirmations = 0;
before(async () => {
web3 = web3Factory.create();
zeroEx = new ZeroEx(web3.currentProvider);
@@ -73,7 +74,7 @@ describe('OrderStateWatcher', () => {
expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerAllowance);
done();
};
- zeroEx.orderStateWatcher.subscribe(callback);
+ zeroEx.orderStateWatcher.subscribe(callback, numConfirmations);
await zeroEx.token.setProxyAllowanceAsync(makerToken.address, maker, new BigNumber(0));
})().catch(done);
});
@@ -91,7 +92,7 @@ describe('OrderStateWatcher', () => {
expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerBalance);
done();
};
- zeroEx.orderStateWatcher.subscribe(callback);
+ zeroEx.orderStateWatcher.subscribe(callback, numConfirmations);
const anyRecipient = taker;
const makerBalance = await zeroEx.token.getBalanceAsync(makerToken.address, maker);
await zeroEx.token.transferAsync(makerToken.address, maker, anyRecipient, makerBalance);
@@ -116,7 +117,7 @@ describe('OrderStateWatcher', () => {
done();
}
};
- zeroEx.orderStateWatcher.subscribe(callback);
+ zeroEx.orderStateWatcher.subscribe(callback, numConfirmations);
const shouldThrowOnInsufficientBalanceOrAllowance = true;
await zeroEx.exchange.fillOrderAsync(
@@ -150,7 +151,7 @@ describe('OrderStateWatcher', () => {
done();
}
};
- zeroEx.orderStateWatcher.subscribe(callback);
+ zeroEx.orderStateWatcher.subscribe(callback, numConfirmations);
const shouldThrowOnInsufficientBalanceOrAllowance = true;
await zeroEx.exchange.fillOrderAsync(
signedOrder, fillAmountInBaseUnits, shouldThrowOnInsufficientBalanceOrAllowance, taker,