aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-06-15 07:00:24 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-06-15 07:00:24 +0800
commitd9292a70bfa00715b6b007b0ecd696db02b1d042 (patch)
tree82831c12998da930427f1be3eb11b7d91ccc5406 /packages/contracts
parenta9c23b7c2857a826756b919e6be73456536e344d (diff)
downloaddexon-sol-tools-d9292a70bfa00715b6b007b0ecd696db02b1d042.tar.gz
dexon-sol-tools-d9292a70bfa00715b6b007b0ecd696db02b1d042.tar.zst
dexon-sol-tools-d9292a70bfa00715b6b007b0ecd696db02b1d042.zip
Remove unused variables and other small fixes
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/package.json2
-rw-r--r--packages/contracts/src/utils/web3_wrapper.ts11
2 files changed, 7 insertions, 6 deletions
diff --git a/packages/contracts/package.json b/packages/contracts/package.json
index ad7cbf476..2495795dc 100644
--- a/packages/contracts/package.json
+++ b/packages/contracts/package.json
@@ -19,7 +19,7 @@
"rebuild_and_test": "run-s build test",
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
"test:profiler": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html",
- "test:trace": "SOLIDITY_REVERT_TRACE=true run-s run_mocha",
+ "test:trace": "SOLIDITY_REVERT_TRACE=true run-s build run_mocha",
"run_mocha": "mocha --require source-map-support/register 'lib/test/**/*.js' --timeout 100000 --bail --exit",
"compile": "sol-compiler",
"clean": "shx rm -rf lib src/generated_contract_wrappers",
diff --git a/packages/contracts/src/utils/web3_wrapper.ts b/packages/contracts/src/utils/web3_wrapper.ts
index f51ad435b..772e4c613 100644
--- a/packages/contracts/src/utils/web3_wrapper.ts
+++ b/packages/contracts/src/utils/web3_wrapper.ts
@@ -7,6 +7,8 @@ import { coverage } from './coverage';
import { profiler } from './profiler';
import { revertTrace } from './revert_trace';
+import * as _ from 'lodash';
+
enum ProviderType {
Ganache = 'ganache',
Geth = 'geth',
@@ -50,11 +52,10 @@ export const provider = web3Factory.getRpcProvider(providerConfigs);
const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
const isProfilerEnabled = env.parseBoolean(EnvVars.SolidityProfiler);
const isRevertTraceEnabled = env.parseBoolean(EnvVars.SolidityRevertTrace);
-// TODO(albrow): Include revertTrace checks in the warnings below.
-if (isCoverageEnabled && isProfilerEnabled) {
- throw new Error(
- `Unfortunately for now you can't enable both coverage and profiler at the same time. They both use coverage.json file and there is no way to configure that.`,
- );
+const enabledSubproviderCount = _.filter([isCoverageEnabled, isProfilerEnabled, isRevertTraceEnabled], _.identity)
+ .length;
+if (enabledSubproviderCount > 1) {
+ throw new Error(`Only one of coverage, profiler, and revert trace subproviders can be enabled at a time`);
}
if (isCoverageEnabled) {
const coverageSubprovider = coverage.getCoverageSubproviderSingleton();