diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-06 14:03:14 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-04-06 14:03:14 +0800 |
commit | 24454938e51e40ae74809f15bd1f612c69c218ec (patch) | |
tree | 706a1a738d3e0a172c62343c0dfb5bad39163d9f /packages/0x.js/test/ether_token_wrapper_test.ts | |
parent | 89a72ebf0dbff606d511ae51bfee7ffc0a5df18f (diff) | |
download | dexon-0x-contracts-24454938e51e40ae74809f15bd1f612c69c218ec.tar.gz dexon-0x-contracts-24454938e51e40ae74809f15bd1f612c69c218ec.tar.zst dexon-0x-contracts-24454938e51e40ae74809f15bd1f612c69c218ec.zip |
Move away from using web3 directly in 0x.js tests
Diffstat (limited to 'packages/0x.js/test/ether_token_wrapper_test.ts')
-rw-r--r-- | packages/0x.js/test/ether_token_wrapper_test.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts index 5be3eaff3..e1ae34edb 100644 --- a/packages/0x.js/test/ether_token_wrapper_test.ts +++ b/packages/0x.js/test/ether_token_wrapper_test.ts @@ -3,7 +3,6 @@ import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import 'mocha'; -import * as Web3 from 'web3'; import { ApprovalContractEventArgs, @@ -24,7 +23,7 @@ import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; import { reportNodeCallbackErrors } from './utils/report_callback_errors'; import { TokenUtils } from './utils/token_utils'; -import { web3, web3Wrapper } from './utils/web3_wrapper'; +import { provider, web3Wrapper } from './utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; @@ -55,7 +54,7 @@ describe('EtherTokenWrapper', () => { const depositAmount = new BigNumber(42); const withdrawalAmount = new BigNumber(42); before(async () => { - zeroEx = new ZeroEx(web3.currentProvider, zeroExConfig); + zeroEx = new ZeroEx(provider, zeroExConfig); tokens = await zeroEx.tokenRegistry.getTokensAsync(); userAddresses = await zeroEx.getAvailableAddressesAsync(); addressWithETH = userAddresses[0]; @@ -79,7 +78,7 @@ describe('EtherTokenWrapper', () => { const UNKNOWN_NETWORK_NETWORK_ID = 10; expect( () => - new ZeroEx(web3.currentProvider, { + new ZeroEx(provider, { networkId: UNKNOWN_NETWORK_NETWORK_ID, } as any), ).to.throw(); @@ -261,7 +260,7 @@ describe('EtherTokenWrapper', () => { callbackNeverToBeCalled, ); const callbackToBeCalled = reportNodeCallbackErrors(done)(); - const newProvider = web3.currentProvider; + const newProvider = provider; zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID); await zeroEx.etherToken.depositAsync(etherTokenAddress, transferAmount, addressWithETH); zeroEx.etherToken.subscribe( |