aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-04-13 11:16:30 +0800
committerJacob Evans <jacob@dekz.net>2018-04-13 11:16:30 +0800
commit73e23996a64f2d0b7f6da855e2c918496e0348f6 (patch)
tree8745d5f9917c3b4a98cfc4bc98c406dfc7e00a67 /packages/dev-utils
parente40bce253c961641b7eeb50b0932be530646dddc (diff)
downloaddexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.tar
dexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.tar.gz
dexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.tar.bz2
dexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.tar.lz
dexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.tar.xz
dexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.tar.zst
dexon-sol-tools-73e23996a64f2d0b7f6da855e2c918496e0348f6.zip
Remove truffle-hdwallet from 0x.js tests
Diffstat (limited to 'packages/dev-utils')
-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..5519bec2b 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,
}),
);
}