aboutsummaryrefslogtreecommitdiffstats
path: root/test/order_watcher_test.ts
blob: e62b1aab206e5eae1aee43c85c2bb4fc70ba5f4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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.skip('TODO', () => {
        // TODO
    });
});