Move away from using web3 directly in 0x.js tests

This commit is contained in:
Fabio Berger
2018-04-06 15:03:14 +09:00
parent 89a72ebf0d
commit 24454938e5
17 changed files with 75 additions and 75 deletions

View File

@@ -4,7 +4,6 @@ import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
import 'mocha';
import * as Web3 from 'web3';
import {
BlockRange,
@@ -26,7 +25,7 @@ import { constants } from './utils/constants';
import { FillScenarios } from './utils/fill_scenarios';
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;
@@ -46,7 +45,7 @@ describe('ExchangeWrapper', () => {
networkId: constants.TESTRPC_NETWORK_ID,
};
before(async () => {
zeroEx = new ZeroEx(web3.currentProvider, config);
zeroEx = new ZeroEx(provider, config);
exchangeContractAddress = zeroEx.exchange.getContractAddress();
userAddresses = await zeroEx.getAvailableAddressesAsync();
tokens = await zeroEx.tokenRegistry.getTokensAsync();
@@ -977,7 +976,7 @@ describe('ExchangeWrapper', () => {
);
zeroEx.exchange.subscribe(ExchangeEvents.LogFill, indexFilterValues, callbackNeverToBeCalled);
const newProvider = web3.currentProvider;
const newProvider = provider;
zeroEx.setProvider(newProvider, constants.TESTRPC_NETWORK_ID);
const callback = reportNodeCallbackErrors(done)(