diff options
Diffstat (limited to 'packages/metacoin')
-rw-r--r-- | packages/metacoin/contracts/Metacoin.sol | 6 | ||||
-rw-r--r-- | packages/metacoin/package.json | 22 | ||||
-rw-r--r-- | packages/metacoin/test/utils/config.ts | 4 | ||||
-rw-r--r-- | packages/metacoin/test/utils/coverage.ts | 5 | ||||
-rw-r--r-- | packages/metacoin/test/utils/web3_wrapper.ts | 12 |
5 files changed, 26 insertions, 23 deletions
diff --git a/packages/metacoin/contracts/Metacoin.sol b/packages/metacoin/contracts/Metacoin.sol index ac212b32e..dc67e6242 100644 --- a/packages/metacoin/contracts/Metacoin.sol +++ b/packages/metacoin/contracts/Metacoin.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.21; +pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; contract Metacoin { @@ -16,7 +16,7 @@ contract Metacoin { uint32 callback; } - function Metacoin() public { + constructor () public { balances[msg.sender] = 10000; } @@ -24,7 +24,7 @@ contract Metacoin { if (balances[msg.sender] < transferData.amount) return false; balances[msg.sender] -= transferData.amount; balances[transferData.to] += transferData.amount; - Transfer(msg.sender, transferData.to, transferData.amount); + emit Transfer(msg.sender, transferData.to, transferData.amount); return true; } 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", 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); |