aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 07:10:47 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 09:06:13 +0800
commit84c965d459b948eb03cb8a70a66663bd7b35f463 (patch)
treefbcb47a43d4b029c2f1a46644eb64ca1d75f5921 /test
parent22cd6989a0217f2a49e59ce64bcc69b2c238aba4 (diff)
downloaddexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.gz
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.bz2
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.lz
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.xz
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.tar.zst
dexon-sol-tools-84c965d459b948eb03cb8a70a66663bd7b35f463.zip
Remove blockStore and default to numConfirmations === 0
Diffstat (limited to 'test')
-rw-r--r--test/event_watcher_test.ts5
-rw-r--r--test/order_state_watcher_test.ts16
2 files changed, 9 insertions, 12 deletions
diff --git a/test/event_watcher_test.ts b/test/event_watcher_test.ts
index 2673f978b..b4164fe63 100644
--- a/test/event_watcher_test.ts
+++ b/test/event_watcher_test.ts
@@ -8,7 +8,6 @@ import {chaiSetup} from './utils/chai_setup';
import {web3Factory} from './utils/web3_factory';
import {Web3Wrapper} from '../src/web3_wrapper';
import {EventWatcher} from '../src/order_watcher/event_watcher';
-import {BlockStore} from '../src/stores/block_store';
import {
ZeroEx,
LogEvent,
@@ -24,7 +23,6 @@ describe('EventWatcher', () => {
let stubs: Sinon.SinonStub[] = [];
let eventWatcher: EventWatcher;
let web3Wrapper: Web3Wrapper;
- let blockStore: BlockStore;
const numConfirmations = 0;
const logA: Web3.LogEntry = {
address: '0x71d271f8b14adef568f8f28f1587ce7271ac4ca5',
@@ -60,8 +58,7 @@ describe('EventWatcher', () => {
web3 = web3Factory.create();
const pollingIntervalMs = 10;
web3Wrapper = new Web3Wrapper(web3.currentProvider);
- blockStore = new BlockStore(numConfirmations);
- eventWatcher = new EventWatcher(web3Wrapper, blockStore, pollingIntervalMs);
+ eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalMs);
});
afterEach(() => {
// clean up any stubs after the test has completed
diff --git a/test/order_state_watcher_test.ts b/test/order_state_watcher_test.ts
index 880ef0fc3..76ecd5dd4 100644
--- a/test/order_state_watcher_test.ts
+++ b/test/order_state_watcher_test.ts
@@ -94,8 +94,8 @@ describe('OrderStateWatcher', () => {
zeroEx.orderStateWatcher.unsubscribe();
});
it('should fail when trying to subscribe twice', async () => {
- await zeroEx.orderStateWatcher.subscribeAsync(_.noop);
- return expect(zeroEx.orderStateWatcher.subscribeAsync(_.noop))
+ await zeroEx.orderStateWatcher.subscribe(_.noop);
+ return expect(zeroEx.orderStateWatcher.subscribe(_.noop))
.to.be.rejectedWith(ZeroExError.SubscriptionAlreadyPresent);
});
});
@@ -119,7 +119,7 @@ describe('OrderStateWatcher', () => {
expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerAllowance);
done();
});
- await zeroEx.orderStateWatcher.subscribeAsync(callback);
+ await zeroEx.orderStateWatcher.subscribe(callback);
await zeroEx.token.setProxyAllowanceAsync(makerToken.address, maker, new BigNumber(0));
})().catch(done);
});
@@ -158,7 +158,7 @@ describe('OrderStateWatcher', () => {
expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerBalance);
done();
});
- await zeroEx.orderStateWatcher.subscribeAsync(callback);
+ zeroEx.orderStateWatcher.subscribe(callback);
const anyRecipient = taker;
const makerBalance = await zeroEx.token.getBalanceAsync(makerToken.address, maker);
await zeroEx.token.transferAsync(makerToken.address, maker, anyRecipient, makerBalance);
@@ -183,7 +183,7 @@ describe('OrderStateWatcher', () => {
done();
}
});
- await zeroEx.orderStateWatcher.subscribeAsync(callback);
+ zeroEx.orderStateWatcher.subscribe(callback);
const shouldThrowOnInsufficientBalanceOrAllowance = true;
await zeroEx.exchange.fillOrderAsync(
@@ -220,7 +220,7 @@ describe('OrderStateWatcher', () => {
done();
}
});
- await zeroEx.orderStateWatcher.subscribeAsync(callback);
+ zeroEx.orderStateWatcher.subscribe(callback);
const shouldThrowOnInsufficientBalanceOrAllowance = true;
await zeroEx.exchange.fillOrderAsync(
signedOrder, fillAmountInBaseUnits, shouldThrowOnInsufficientBalanceOrAllowance, taker,
@@ -321,7 +321,7 @@ describe('OrderStateWatcher', () => {
expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderRemainingFillAmountZero);
done();
});
- await zeroEx.orderStateWatcher.subscribeAsync(callback);
+ zeroEx.orderStateWatcher.subscribe(callback);
const shouldThrowOnInsufficientBalanceOrAllowance = true;
await zeroEx.exchange.cancelOrderAsync(signedOrder, fillableAmount);
@@ -348,7 +348,7 @@ describe('OrderStateWatcher', () => {
expect(orderRelevantState.canceledTakerTokenAmount).to.be.bignumber.equal(cancelAmountInBaseUnits);
done();
});
- await zeroEx.orderStateWatcher.subscribeAsync(callback);
+ zeroEx.orderStateWatcher.subscribe(callback);
await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelAmountInBaseUnits);
})().catch(done);
});