diff --git a/dev-utils/CHANGELOG.json b/dev-utils/CHANGELOG.json index 1d49113602..b3fd9b9a8a 100644 --- a/dev-utils/CHANGELOG.json +++ b/dev-utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.2.0", + "changes": [ + { + "note": "Add `chainId` option to `Web3Config`", + "pr": 20 + } + ] + }, { "timestamp": 1610044030, "version": "4.1.6", diff --git a/dev-utils/src/web3_factory.ts b/dev-utils/src/web3_factory.ts index 00ea3572fd..ab7e02977b 100644 --- a/dev-utils/src/web3_factory.ts +++ b/dev-utils/src/web3_factory.ts @@ -11,6 +11,8 @@ import * as fs from 'fs'; import { constants } from './constants'; import { env, EnvVars } from './env'; +// tslint:disable: custom-no-magic-numbers + export interface Web3Config { total_accounts?: number; // default: 10 hasAddresses?: boolean; // default: true @@ -26,6 +28,7 @@ export interface Web3Config { unlocked_accounts?: string[]; hardfork?: string; // default: istanbul gasLimit?: number; + chainId?: number; // default: 1337 } export const web3Factory = { @@ -65,7 +68,6 @@ export const web3Factory = { const shouldThrowErrorsOnGanacheRPCResponse = config.shouldThrowErrorsOnGanacheRPCResponse === undefined || config.shouldThrowErrorsOnGanacheRPCResponse; - provider.addProvider( new GanacheSubprovider({ total_accounts: config.total_accounts, @@ -76,7 +78,8 @@ export const web3Factory = { logger, verbose: env.parseBoolean(EnvVars.VerboseGanache), port: 8545, - network_id: 50, + network_id: config.chainId === undefined ? 1337 : config.chainId, + _chainId: config.chainId === undefined ? 1337 : config.chainId, mnemonic: 'concert load couple harbor equip island argue ramp clarify fence smart topic', fork: config.fork, blockTime: config.blockTime, diff --git a/subproviders/package.json b/subproviders/package.json index 9fc8dceae8..58e810bea2 100644 --- a/subproviders/package.json +++ b/subproviders/package.json @@ -49,7 +49,7 @@ "ethereum-types": "^3.4.0", "ethereumjs-tx": "^1.3.5", "ethereumjs-util": "^5.1.1", - "ganache-core": "^2.10.2", + "ganache-core": "^2.13.2", "hdkey": "^0.7.1", "json-rpc-error": "2.0.0", "lodash": "^4.17.11", diff --git a/web3-wrapper/package.json b/web3-wrapper/package.json index dd22851982..95781fd7ee 100644 --- a/web3-wrapper/package.json +++ b/web3-wrapper/package.json @@ -47,7 +47,7 @@ "chai-as-promised": "^7.1.0", "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", - "ganache-core": "^2.10.2", + "ganache-core": "^2.13.2", "make-promises-safe": "^1.1.0", "mocha": "^6.2.0", "npm-run-all": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index 8df1e96448..3b2969d576 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5550,10 +5550,10 @@ eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: json-rpc-random-id "^1.0.0" xtend "^4.0.1" -eth-sig-util@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.3.0.tgz#c54a6ac8e8796f7e25f59cf436982a930e645231" - integrity sha512-ugD1AvaggvKaZDgnS19W5qOfepjGc7qHrt7TrAaL54gJw9SHvgIXJ3r2xOMW30RWJZNP+1GlTOy5oye7yXA4xA== +eth-sig-util@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-3.0.0.tgz#75133b3d7c20a5731af0690c385e184ab942b97e" + integrity sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ== dependencies: buffer "^5.2.1" elliptic "^6.4.0" @@ -5642,15 +5642,7 @@ ethereumjs-abi@0.6.5: bn.js "^4.10.0" ethereumjs-util "^4.3.0" -ethereumjs-abi@0.6.7: - version "0.6.7" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.7.tgz#d1d1c5cdb8d910a7d97645ba9e93be5d153bba2e" - integrity sha512-EMLOA8ICO5yAaXDhjVEfYjsJIXYutY8ufTE93eEKwsVtp2usQreKwsDTJ9zvam3omYqNuffr8IONIqb2uUslGQ== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": +ethereumjs-abi@0.6.8, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": version "0.6.8" resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f" dependencies: @@ -6477,10 +6469,10 @@ ganache-cli@6.8.0-istanbul.0: source-map-support "0.5.12" yargs "13.2.4" -ganache-core@^2.10.2: - version "2.13.0" - resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.0.tgz#e211d995eb806a1cd792096a989cf624417f0f7c" - integrity sha512-yTSsesDBwPh+34ZN2w5SZoPNVbR0Gn75InvQc2D1zUdy9prED6R2sVbefSyiXFR/uwZK9NrIVS1+HcEtgQVb9Q== +ganache-core@^2.13.2: + version "2.13.2" + resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.2.tgz#27e6fc5417c10e6e76e2e646671869d7665814a3" + integrity sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw== dependencies: abstract-leveldown "3.0.0" async "2.6.2" @@ -6489,8 +6481,8 @@ ganache-core@^2.10.2: clone "2.1.2" debug "3.2.6" encoding-down "5.0.4" - eth-sig-util "2.3.0" - ethereumjs-abi "0.6.7" + eth-sig-util "3.0.0" + ethereumjs-abi "0.6.8" ethereumjs-account "3.0.0" ethereumjs-block "2.2.2" ethereumjs-common "1.5.0"