aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/helpers.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-19 22:34:28 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-30 23:01:36 +0800
commit709026bf1a49d468850b4ebed845c8598fa4fd75 (patch)
tree496c9889b0494112239cd720315b213a0b89befa /packages/contracts/test/exchange/helpers.ts
parentf2b2b867866faa92256bc175e651e038001cef4d (diff)
downloaddexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.tar
dexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.tar.gz
dexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.tar.bz2
dexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.tar.lz
dexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.tar.xz
dexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.tar.zst
dexon-sol-tools-709026bf1a49d468850b4ebed845c8598fa4fd75.zip
Refactor contracts tests to not use injected web3 instance
Diffstat (limited to 'packages/contracts/test/exchange/helpers.ts')
-rw-r--r--packages/contracts/test/exchange/helpers.ts10
1 files changed, 3 insertions, 7 deletions
diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts
index f6e11f087..7af9866d5 100644
--- a/packages/contracts/test/exchange/helpers.ts
+++ b/packages/contracts/test/exchange/helpers.ts
@@ -1,13 +1,11 @@
import { ZeroEx } from '0x.js';
-import { BlockchainLifecycle } from '@0xproject/dev-utils';
+import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
-import * as Web3 from 'web3';
import { Artifacts } from '../../util/artifacts';
-import { constants } from '../../util/constants';
import { ExchangeWrapper } from '../../util/exchange_wrapper';
import { Order } from '../../util/order';
import { OrderFactory } from '../../util/order_factory';
@@ -17,10 +15,8 @@ chaiSetup.configure();
const expect = chai.expect;
const { Exchange, TokenRegistry } = new Artifacts(artifacts);
-// In order to benefit from type-safety, we re-assign the global web3 instance injected by Truffle
-// with type `any` to a variable of type `Web3`.
-const web3: Web3 = (global as any).web3;
-const blockchainLifecycle = new BlockchainLifecycle(constants.RPC_URL);
+const web3 = web3Factory.create();
+const blockchainLifecycle = new BlockchainLifecycle(devConstants.RPC_URL);
describe('Exchange', () => {
const web3Wrapper = new Web3Wrapper(web3.currentProvider);