diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-08 17:51:46 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-08 17:51:46 +0800 |
commit | b362e2c28e9cafa7335bced17ec61fba93b018e6 (patch) | |
tree | 6a6c65f2a3a17ff93b566fa0c0e7d92032d1a7a0 /packages/contracts/deploy | |
parent | 5401c69163f8fd384038a3ef8c760ec95c661035 (diff) | |
download | dexon-0x-contracts-b362e2c28e9cafa7335bced17ec61fba93b018e6.tar.gz dexon-0x-contracts-b362e2c28e9cafa7335bced17ec61fba93b018e6.tar.zst dexon-0x-contracts-b362e2c28e9cafa7335bced17ec61fba93b018e6.zip |
Refactor networkId out of web3Wrapper
Diffstat (limited to 'packages/contracts/deploy')
-rw-r--r-- | packages/contracts/deploy/src/deployer.ts | 2 | ||||
-rw-r--r-- | packages/contracts/deploy/src/utils/network.ts | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/packages/contracts/deploy/src/deployer.ts b/packages/contracts/deploy/src/deployer.ts index 2d4f31949..4c8018ecc 100644 --- a/packages/contracts/deploy/src/deployer.ts +++ b/packages/contracts/deploy/src/deployer.ts @@ -31,7 +31,7 @@ export class Deployer { const jsonrpcUrl = `http://localhost:${this.jsonrpcPort}`; const web3Provider = new Web3.providers.HttpProvider(jsonrpcUrl); this.defaults = opts.defaults; - this.web3Wrapper = new Web3Wrapper(web3Provider, this.networkId, this.defaults); + this.web3Wrapper = new Web3Wrapper(web3Provider, this.defaults); } /** * Loads contract artifact and deploys contract with given arguments. diff --git a/packages/contracts/deploy/src/utils/network.ts b/packages/contracts/deploy/src/utils/network.ts index fc8709e0f..f9776bb97 100644 --- a/packages/contracts/deploy/src/utils/network.ts +++ b/packages/contracts/deploy/src/utils/network.ts @@ -1,4 +1,5 @@ import {promisify} from '@0xproject/utils'; +import {Web3Wrapper} from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -6,8 +7,8 @@ export const network = { async getNetworkIdIfExistsAsync(port: number): Promise<number> { const url = `http://localhost:${port}`; const web3Provider = new Web3.providers.HttpProvider(url); - const web3 = new Web3(web3Provider); - const networkId = _.parseInt(await promisify<string>(web3.version.getNetwork)()); + const web3Wrapper = new Web3Wrapper(web3Provider); + const networkId = web3Wrapper.getNetworkIdAsync(); return networkId; }, }; |