aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-30 21:01:20 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-10 03:11:45 +0800
commit1980b3fae4ed9c92aa7feb2f1c79ea4b49525341 (patch)
treeb9d337af4762729bf8281487f27aee1bcfd5957f /test
parent6714b8958b4807f86e5f2f46168feb643cae83ff (diff)
downloaddexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.tar
dexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.tar.gz
dexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.tar.bz2
dexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.tar.lz
dexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.tar.xz
dexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.tar.zst
dexon-sol-tools-1980b3fae4ed9c92aa7feb2f1c79ea4b49525341.zip
Add empty implementation of order state watcher
Diffstat (limited to 'test')
-rw-r--r--test/order_watcher_test.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/order_watcher_test.ts b/test/order_watcher_test.ts
new file mode 100644
index 000000000..f273a1d84
--- /dev/null
+++ b/test/order_watcher_test.ts
@@ -0,0 +1,42 @@
+import 'mocha';
+import * as chai from 'chai';
+import * as _ from 'lodash';
+import * as Sinon from 'sinon';
+import * as Web3 from 'web3';
+import BigNumber from 'bignumber.js';
+import {chaiSetup} from './utils/chai_setup';
+import {web3Factory} from './utils/web3_factory';
+import {Web3Wrapper} from '../src/web3_wrapper';
+import {OrderStateWatcher} from '../src/mempool/order_state_watcher';
+import {
+ ZeroEx,
+ LogEvent,
+ DecodedLogEvent,
+} from '../src';
+import {DoneCallback} from '../src/types';
+
+chaiSetup.configure();
+const expect = chai.expect;
+
+describe('EventWatcher', () => {
+ let web3: Web3;
+ let stubs: Sinon.SinonStub[] = [];
+ let orderStateWatcher: OrderStateWatcher;
+ before(async () => {
+ web3 = web3Factory.create();
+ const mempoolPollingIntervalMs = 10;
+ const orderStateWatcherConfig = {
+ mempoolPollingIntervalMs,
+ };
+ orderStateWatcher = new OrderStateWatcher(web3.currentProvider, orderStateWatcherConfig);
+ });
+ afterEach(() => {
+ // clean up any stubs after the test has completed
+ _.each(stubs, s => s.restore());
+ stubs = [];
+ orderStateWatcher.unsubscribe();
+ });
+ it.only('', (done: DoneCallback) => {
+ orderStateWatcher.subscribe(console.log);
+ }).timeout(1000000000000);
+});