aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-15 21:14:36 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-23 06:20:34 +0800
commit1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac (patch)
treee7f1870dab995b33c381924707a17acc1feaf3c8 /packages/contracts/src/utils
parentb86248f13fcb8f326098252beee6ca557e0175e7 (diff)
downloaddexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.tar
dexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.tar.gz
dexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.tar.bz2
dexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.tar.lz
dexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.tar.xz
dexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.tar.zst
dexon-sol-tools-1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac.zip
Remove web3Factory.create and remove dev-tools dependency on sol-cov
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/web3_wrapper.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/contracts/src/utils/web3_wrapper.ts b/packages/contracts/src/utils/web3_wrapper.ts
index ed1c488a2..5d3d9f7c9 100644
--- a/packages/contracts/src/utils/web3_wrapper.ts
+++ b/packages/contracts/src/utils/web3_wrapper.ts
@@ -1,12 +1,18 @@
-import { devConstants, web3Factory } from '@0xproject/dev-utils';
+import { devConstants, env, EnvVars, web3Factory } from '@0xproject/dev-utils';
+import { prependSubprovider } from '@0xproject/subproviders';
import { Provider } from '@0xproject/types';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { coverage } from './coverage';
+
export const txDefaults = {
from: devConstants.TESTRPC_FIRST_ADDRESS,
gas: devConstants.GAS_ESTIMATE,
};
const providerConfigs = { shouldUseInProcessGanache: true };
-export const web3 = web3Factory.create(providerConfigs);
-export const provider = web3.currentProvider;
+export const provider = web3Factory.getRpcProvider(providerConfigs);
+const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
+if (isCoverageEnabled) {
+ prependSubprovider(provider, coverage.getCoverageSubproviderSingleton());
+}
export const web3Wrapper = new Web3Wrapper(provider);