aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils/src/web3_factory.ts
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-04-17 13:06:57 +0800
committerGitHub <noreply@github.com>2018-04-17 13:06:57 +0800
commit2193d9ae6ef25d08d5524f6d2622f3371dbea3d1 (patch)
tree5a6dbbf7fcb1dced1ace80c03343ca789dc49b54 /packages/dev-utils/src/web3_factory.ts
parentd263f7783fabe89cc9714b596068eccdc5babc1c (diff)
parent79d01fe2d7582266dafedefee2873c9d488f4a20 (diff)
downloaddexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.gz
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.bz2
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.lz
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.xz
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.tar.zst
dexon-sol-tools-2193d9ae6ef25d08d5524f6d2622f3371dbea3d1.zip
Merge pull request #524 from 0xProject/feature/0x.js/remove-hd-wallet-from-test
Remove truffle-hdwallet from 0x.js tests
Diffstat (limited to 'packages/dev-utils/src/web3_factory.ts')
-rw-r--r--packages/dev-utils/src/web3_factory.ts6
1 files changed, 5 insertions, 1 deletions
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,
}),
);
}