diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-02 18:31:16 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-02 18:31:16 +0800 |
commit | fc3be810a25ce98402c686bd41606e08e7b5c2ac (patch) | |
tree | da0d7ee884c9df78ee7fc0659517075461b35096 /test/0x.js_test.ts | |
parent | 104b7f2549e0164f629594c590b3d2d936ba66d0 (diff) | |
download | dexon-0x-contracts-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.gz dexon-0x-contracts-fc3be810a25ce98402c686bd41606e08e7b5c2ac.tar.zst dexon-0x-contracts-fc3be810a25ce98402c686bd41606e08e7b5c2ac.zip |
Implement zeroEx.exchange.subscribeAsync made sure to clean up subscriptions if user updates the provider
Diffstat (limited to 'test/0x.js_test.ts')
-rw-r--r-- | test/0x.js_test.ts | 6 |
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(); |