diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-12 10:19:39 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-12 10:37:30 +0800 |
commit | c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d (patch) | |
tree | e51b2242419174ae7e77a8eaea74918607be070e /packages/deployer/src/deployer.ts | |
parent | 7143996d265cde74c473467439158ae557d9f8a8 (diff) | |
download | dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.gz dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.bz2 dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.lz dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.xz dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.tar.zst dexon-sol-tools-c4a18ee64b58217dd9733c9b9edbfe592fc1cb8d.zip |
Make Deployer configurable by jsonrpcUrl instead of jsonrpcPort
Diffstat (limited to 'packages/deployer/src/deployer.ts')
-rw-r--r-- | packages/deployer/src/deployer.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/deployer/src/deployer.ts b/packages/deployer/src/deployer.ts index b72219d6e..94f6938fc 100644 --- a/packages/deployer/src/deployer.ts +++ b/packages/deployer/src/deployer.ts @@ -10,7 +10,7 @@ import { ContractArtifact, ContractNetworkData, DeployerOptions, - PortDeployerOptions, + UrlDeployerOptions, ProviderDeployerOptions, } from './utils/types'; import { utils } from './utils/utils'; @@ -30,13 +30,13 @@ export class Deployer { this._defaults = opts.defaults; let web3Provider: Web3.Provider; if (_.isUndefined((opts as ProviderDeployerOptions).web3Provider)) { - const jsonrpcPort = (opts as PortDeployerOptions).jsonrpcPort; - if (_.isUndefined(jsonrpcPort)) { + const jsonrpcUrl = (opts as UrlDeployerOptions).jsonrpcUrl; + if (_.isUndefined(jsonrpcUrl)) { throw new Error( - `Deployer options don't have neither web3Provider nor jsonrpcPort. Please pass one of them`, + `Deployer options don't have neither web3Provider nor jsonrpcUrl. Please pass one of them`, ); } - web3Provider = new Web3.providers.HttpProvider(`http://localhost:${jsonrpcPort}`); + web3Provider = new Web3.providers.HttpProvider(jsonrpcUrl); } else { web3Provider = (opts as ProviderDeployerOptions).web3Provider; } |