aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-02 18:31:16 +0800
committerFabio Berger <me@fabioberger.com>2017-06-02 18:31:16 +0800
commitfc3be810a25ce98402c686bd41606e08e7b5c2ac (patch)
treeda0d7ee884c9df78ee7fc0659517075461b35096 /test
parent104b7f2549e0164f629594c590b3d2d936ba66d0 (diff)
downloaddexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar
dexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.gz
dexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.bz2
dexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.lz
dexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.xz
dexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.zst
dexon-sol-tools-fc3be810a25ce98402c686bd41606e08e7b5c2ac.zip
Implement zeroEx.exchange.subscribeAsync made sure to clean up subscriptions if user updates the provider
Diffstat (limited to 'test')
-rw-r--r--test/0x.js_test.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts
index efc703ea1..52580171b 100644
--- a/test/0x.js_test.ts
+++ b/test/0x.js_test.ts
@@ -8,7 +8,7 @@ import * as Sinon from 'sinon';
import {ZeroEx} from '../src/0x.js';
import {constants} from './utils/constants';
import {web3Factory} from './utils/web3_factory';
-import {Order} from '../src/types';
+import {Order, DoneCallback} from '../src/types';
chai.use(ChaiBigNumber());
chai.use(dirtyChai);
@@ -16,7 +16,7 @@ const expect = chai.expect;
describe('ZeroEx library', () => {
describe('#setProvider', () => {
- it('overrides the provider in the nested web3 instance and invalidates contractInstances', async () => {
+ it('overrides provider in nested web3s and invalidates contractInstances', async () => {
const web3 = web3Factory.create();
const zeroEx = new ZeroEx(web3);
// Instantiate the contract instances with the current provider
@@ -28,7 +28,7 @@ describe('ZeroEx library', () => {
const newProvider = web3Factory.getRpcProvider();
// Add property to newProvider so that we can differentiate it from old provider
(newProvider as any).zeroExTestId = 1;
- zeroEx.setProvider(newProvider);
+ await zeroEx.setProviderAsync(newProvider);
// Check that contractInstances with old provider are removed after provider update
expect((zeroEx.exchange as any).exchangeContractIfExists).to.be.undefined();