From 974575b695108dd70f4b165f6789f71c3647c2b1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 May 2018 20:01:18 +0200 Subject: Make sol-cov work with truffle and other artifact adapters --- packages/metacoin/test/utils/config.ts | 4 ++-- packages/metacoin/test/utils/coverage.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/metacoin') 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..83b56596f 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, ZeroExArtifactAdapter } 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 ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); + return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); }, }; -- cgit v1.2.3 From 1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 15:14:36 +0200 Subject: Remove web3Factory.create and remove dev-tools dependency on sol-cov --- packages/metacoin/test/utils/web3_wrapper.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'packages/metacoin') diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts index b4bb61f09..9f6b155fc 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,9 @@ provider.addProvider( ); provider.start(); +const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); +if (isCoverageEnabled) { + prependSubprovider(provider, coverage.getCoverageSubproviderSingleton()); +} + export const web3Wrapper = new Web3Wrapper(provider); -- cgit v1.2.3 From 6aafda45170d77f9e10025ce119d47d9710a87ec Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:42:37 -0700 Subject: Assign then pass --- packages/metacoin/test/utils/web3_wrapper.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/metacoin') diff --git a/packages/metacoin/test/utils/web3_wrapper.ts b/packages/metacoin/test/utils/web3_wrapper.ts index 9f6b155fc..724ed4e1f 100644 --- a/packages/metacoin/test/utils/web3_wrapper.ts +++ b/packages/metacoin/test/utils/web3_wrapper.ts @@ -25,7 +25,8 @@ provider.start(); const isCoverageEnabled = env.parseBoolean(EnvVars.SolidityCoverage); if (isCoverageEnabled) { - prependSubprovider(provider, coverage.getCoverageSubproviderSingleton()); + const coverageSubprovider = coverage.getCoverageSubproviderSingleton(); + prependSubprovider(provider, coverageSubprovider); } export const web3Wrapper = new Web3Wrapper(provider); -- cgit v1.2.3 From 86f17fb466124ad4ecd9e4ac47e7fecde8f585ee Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:44:25 -0700 Subject: Rename ZeroExArtifactAdapter to SolCompilerArtifactAdapter --- packages/metacoin/test/utils/coverage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/metacoin') diff --git a/packages/metacoin/test/utils/coverage.ts b/packages/metacoin/test/utils/coverage.ts index 83b56596f..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, ZeroExArtifactAdapter } from '@0xproject/sol-cov'; +import { CoverageSubprovider, SolCompilerArtifactAdapter } from '@0xproject/sol-cov'; import * as _ from 'lodash'; import { config } from './config'; @@ -15,7 +15,7 @@ export const coverage = { }, _getCoverageSubprovider(): CoverageSubprovider { const defaultFromAddress = devConstants.TESTRPC_FIRST_ADDRESS; - const zeroExArtifactsAdapter = new ZeroExArtifactAdapter(config.artifactsDir, config.contractsDir); + const zeroExArtifactsAdapter = new SolCompilerArtifactAdapter(config.artifactsDir, config.contractsDir); return new CoverageSubprovider(zeroExArtifactsAdapter, defaultFromAddress); }, }; -- cgit v1.2.3 From 84a1b5612de3b22bbe6b8b01a997234771d98005 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:26:47 -0700 Subject: Publish - 0x.js@0.38.0 - @0xproject/abi-gen@0.3.0 - @0xproject/assert@0.2.10 - @0xproject/base-contract@0.3.2 - @0xproject/connect@0.6.13 - @0xproject/contract-wrappers@0.0.2 - contracts@2.1.29 - @0xproject/dev-utils@0.4.2 - @0xproject/fill-scenarios@0.0.2 - @0xproject/json-schemas@0.7.24 - @0xproject/metacoin@0.0.7 - @0xproject/migrations@0.0.6 - @0xproject/monorepo-scripts@0.1.20 - @0xproject/order-utils@0.0.5 - @0xproject/order-watcher@0.0.2 - @0xproject/react-docs-example@0.0.12 - @0xproject/react-docs@0.0.12 - @0xproject/react-shared@0.1.7 - @0xproject/sol-compiler@0.5.0 - @0xproject/sol-cov@0.0.11 - @0xproject/sol-resolver@0.0.5 - @0xproject/sra-report@0.1.0 - @0xproject/subproviders@0.10.2 - @0xproject/testnet-faucets@1.0.30 - @0xproject/tslint-config@0.4.18 - @0xproject/types@0.7.0 - @0xproject/typescript-typings@0.3.2 - @0xproject/utils@0.6.2 - @0xproject/web3-wrapper@0.6.4 - @0xproject/website@0.0.33 --- packages/metacoin/package.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'packages/metacoin') diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 83d083b3f..312aa0819 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/metacoin", - "version": "0.0.6", + "version": "0.0.7", "engines": { "node": ">=6.12" }, @@ -26,21 +26,21 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@0xproject/abi-gen": "^0.2.13", - "@0xproject/base-contract": "^0.3.1", - "@0xproject/sol-compiler": "^0.4.3", - "@0xproject/sol-cov": "^0.0.10", - "@0xproject/subproviders": "^0.10.1", - "@0xproject/tslint-config": "^0.4.17", - "@0xproject/types": "^0.6.3", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/abi-gen": "^0.3.0", + "@0xproject/base-contract": "^0.3.2", + "@0xproject/sol-compiler": "^0.5.0", + "@0xproject/sol-cov": "^0.0.11", + "@0xproject/subproviders": "^0.10.2", + "@0xproject/tslint-config": "^0.4.18", + "@0xproject/types": "^0.7.0", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "ethers": "^3.0.15", "lodash": "^4.17.4", "web3-provider-engine": "^14.0.4" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", + "@0xproject/dev-utils": "^0.4.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^2.0.1", -- cgit v1.2.3