aboutsummaryrefslogtreecommitdiffstats
path: root/packages/metacoin/test/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-24 03:01:38 +0800
committerGitHub <noreply@github.com>2018-05-24 03:01:38 +0800
commit513007a82ce9065d44694516bc94771ee4bc2c6f (patch)
treefe156fa4bb2dc5fecd2df4dd1fcd82e1e3007821 /packages/metacoin/test/utils
parentaf0d9439d4f4e05fce8018665e375cf2db07184c (diff)
parentbf18a90da79d43e90901b0cd156f15398e215d91 (diff)
downloaddexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.tar
dexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.tar.gz
dexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.tar.bz2
dexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.tar.lz
dexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.tar.xz
dexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.tar.zst
dexon-sol-tools-513007a82ce9065d44694516bc94771ee4bc2c6f.zip
Merge pull request #589 from 0xProject/feature/truffle-sol-cov
Sol-cov artifact Adapters (truffle)
Diffstat (limited to 'packages/metacoin/test/utils')
-rw-r--r--packages/metacoin/test/utils/config.ts4
-rw-r--r--packages/metacoin/test/utils/coverage.ts5
-rw-r--r--packages/metacoin/test/utils/web3_wrapper.ts12
3 files changed, 12 insertions, 9 deletions
diff --git a/packages/metacoin/test/utils/config.ts b/packages/metacoin/test/utils/config.ts
index 389edb388..ef4932845 100644
--- a/packages/metacoin/test/utils/config.ts
+++ b/packages/metacoin/test/utils/config.ts
@@ -3,8 +3,8 @@ import * as path from 'path';
export const config = {
networkId: 50,
- artifactsDir: path.resolve(__dirname, '../../artifacts'),
- contractsDir: path.resolve(__dirname, '../../contracts'),
+ artifactsDir: 'artifacts',
+ contractsDir: 'contracts',
ganacheLogFile: 'ganache.log',
txDefaults: {
from: devConstants.TESTRPC_FIRST_ADDRESS,
diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts
index debd544ed..945afb0a7 100644
--- a/packages/metacoin/test/utils/coverage.ts
+++ b/packages/metacoin/test/utils/coverage.ts
@@ -1,5 +1,5 @@
import { devConstants } from '@0xproject/dev-utils';
-import { CoverageSubprovider } from '@0xproject/sol-cov';
+import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov';
import * as _ from 'lodash';
import { config } from './config';
@@ -15,6 +15,7 @@ export const coverage = {
},
_getCoverageSubprovider(): CoverageSubprovider {
const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS;
- return new CoverageSubprovider(config.artifactsDir, config.contractsDir, defaultFromAddress);
+ const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir);
+ return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress);
},
};
diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts
index b4bb61f09..724ed4e1f 100644
--- a/packages/metacoin/test/utils/web3_wrapper.ts
+++ b/packages/metacoin/test/utils/web3_wrapper.ts
@@ -1,5 +1,5 @@
import { env, EnvVars } from '@0xproject/dev-utils';
-import { GanacheSubprovider } from '@0xproject/subproviders';
+import { GanacheSubprovider, prependSubprovider } from '@0xproject/subproviders';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as fs from 'fs';
import * as _ from 'lodash';
@@ -9,10 +9,6 @@ import { config } from './config';
import { coverage } from './coverage';
export const provider = new ProviderEngine();
-const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
-if (isCoverageEnabled) {
- provider.addProvider(coverage.getCoverageSubproviderSingleton());
-}
provider.addProvider(
new GanacheSubprovider({
logger: {
@@ -27,4 +23,10 @@ provider.addProvider(
);
provider.start();
+const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage);
+if (isCoverageEnabled) {
+ const coverageSubprovider = coverage.getCoverageSubproviderSingleton();
+ prependSubprovider(provider, coverageSubprovider);
+}
+
export const web3Wrapper = new Web3Wrapper(provider);