diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/0x.js/CHANGELOG.json | 8 | ||||
-rw-r--r-- | packages/0x.js/package.json | 1 | ||||
-rw-r--r-- | packages/0x.js/test/artifacts_test.ts | 12 | ||||
-rw-r--r-- | packages/dev-utils/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/dev-utils/src/web3_factory.ts | 6 |
5 files changed, 25 insertions, 11 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index 9b5c52d00..8be892215 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -1,5 +1,13 @@ [ { + "version": "0.36.1", + "changes": [ + { + "note": "Internal changes and refactoring" + } + ] + }, + { "version": "0.36.0", "changes": [ { diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index cd339e770..37a321dbd 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -89,7 +89,6 @@ "shx": "^0.2.2", "sinon": "^4.0.0", "source-map-support": "^0.5.0", - "truffle-hdwallet-provider": "^0.0.3", "tslint": "5.8.0", "typedoc": "0xProject/typedoc", "typescript": "2.7.1", diff --git a/packages/0x.js/test/artifacts_test.ts b/packages/0x.js/test/artifacts_test.ts index 17f068a2e..40c5983bd 100644 --- a/packages/0x.js/test/artifacts_test.ts +++ b/packages/0x.js/test/artifacts_test.ts @@ -1,5 +1,5 @@ +import { web3Factory } from '@0xproject/dev-utils'; import * as fs from 'fs'; -import HDWalletProvider = require('truffle-hdwallet-provider'); import { ZeroEx } from '../src'; @@ -14,10 +14,7 @@ const TIMEOUT = 10000; describe('Artifacts', () => { describe('contracts are deployed on kovan', () => { const kovanRpcUrl = constants.KOVAN_RPC_URL; - const packageJSONContent = fs.readFileSync('package.json', 'utf-8'); - const packageJSON = JSON.parse(packageJSONContent); - const mnemonic = packageJSON.config.mnemonic; - const provider = new HDWalletProvider(mnemonic, kovanRpcUrl); + const provider = web3Factory.create({ rpcUrl: kovanRpcUrl }).currentProvider; const config = { networkId: constants.KOVAN_NETWORK_ID, }; @@ -34,10 +31,7 @@ describe('Artifacts', () => { }); describe('contracts are deployed on ropsten', () => { const ropstenRpcUrl = constants.ROPSTEN_RPC_URL; - const packageJSONContent = fs.readFileSync('package.json', 'utf-8'); - const packageJSON = JSON.parse(packageJSONContent); - const mnemonic = packageJSON.config.mnemonic; - const provider = new HDWalletProvider(mnemonic, ropstenRpcUrl); + const provider = web3Factory.create({ rpcUrl: ropstenRpcUrl }).currentProvider; const config = { networkId: constants.ROPSTEN_NETWORK_ID, }; diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index b5dd3732d..8faf71d6a 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "0.3.6", + "changes": [ + { + "note": "Allow an rpcURL to be set in Web3Config (for testnet RPC endpoints)", + "pr": 524 + } + ] + }, + { "timestamp": 1523462196, "version": "0.3.5", "changes": [ diff --git a/packages/dev-utils/src/web3_factory.ts b/packages/dev-utils/src/web3_factory.ts index f45c36930..68348d671 100644 --- a/packages/dev-utils/src/web3_factory.ts +++ b/packages/dev-utils/src/web3_factory.ts @@ -26,6 +26,7 @@ import * as Web3 from 'web3'; export interface Web3Config { hasAddresses?: boolean; // default: true shouldUseInProcessGanache?: boolean; // default: false + rpcUrl?: string; // default: localhost:8545 } export const web3Factory = { @@ -53,6 +54,9 @@ export const web3Factory = { }; const shouldUseInProcessGanache = !!config.shouldUseInProcessGanache; if (shouldUseInProcessGanache) { + if (!_.isUndefined(config.rpcUrl)) { + throw new Error('Cannot use both GanacheSubrovider and RPCSubprovider'); + } provider.addProvider( new GanacheSubprovider({ logger, @@ -65,7 +69,7 @@ export const web3Factory = { } else { provider.addProvider( new RpcSubprovider({ - rpcUrl: constants.RPC_URL, + rpcUrl: config.rpcUrl || constants.RPC_URL, }), ); } |