aboutsummaryrefslogtreecommitdiffstats
path: root/packages/metacoin/test/utils/coverage.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-04-02 19:57:44 +0800
committerGitHub <noreply@github.com>2018-04-02 19:57:44 +0800
commitd95b1e2db499d0264a1020be1ec453c5136b5a3b (patch)
treeb26623424303ff4d5ba17080b53ef40d037a1426 /packages/metacoin/test/utils/coverage.ts
parent695b697cdf6c73bb4b5f920869ce128f9a9e7523 (diff)
parentc1d6c7ff66079731df405e25c4b2aa83c86fffb9 (diff)
downloaddexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.tar
dexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.tar.gz
dexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.tar.bz2
dexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.tar.lz
dexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.tar.xz
dexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.tar.zst
dexon-sol-tools-d95b1e2db499d0264a1020be1ec453c5136b5a3b.zip
Merge pull request #485 from 0xProject/feature/metacoin
Add metacoin example project
Diffstat (limited to 'packages/metacoin/test/utils/coverage.ts')
-rw-r--r--packages/metacoin/test/utils/coverage.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts
new file mode 100644
index 000000000..6b249384f
--- /dev/null
+++ b/packages/metacoin/test/utils/coverage.ts
@@ -0,0 +1,20 @@
+import { devConstants } from '@0xproject/dev-utils';
+import { CoverageSubprovider } from '@0xproject/sol-cov';
+import * as _ from 'lodash';
+
+import { config } from './config';
+
+let coverageSubprovider: CoverageSubprovider;
+
+export const coverage = {
+ getCoverageSubproviderSingleton(): CoverageSubprovider {
+ if (_.isUndefined(coverageSubprovider)) {
+ coverageSubprovider = coverage._getCoverageSubprovider();
+ }
+ return coverageSubprovider;
+ },
+ _getCoverageSubprovider(): CoverageSubprovider {
+ const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS;
+ return new CoverageSubprovider(config.artifactsDir, config.contractsDir, config.networkId, defaultFromAddress);
+ },
+};