Cleanup scripts and use helper to get the networkid

This commit is contained in:
2019-03-27 17:06:52 +01:00
parent b201642485
commit 258c6729b6
3 changed files with 12 additions and 30 deletions

View File

@@ -6,6 +6,7 @@ const argv = require('yargs').argv
const namehash = require('eth-ens-namehash').hash
const fileInject = require('./helpers/file_inject.js')
const getNetworkId = require('./helpers/networkid.js')
const DAOFactory = artifacts.require('DAOFactory')
const KreditsKit = artifacts.require('KreditsKit')
@@ -18,18 +19,7 @@ const daoFactoryAddress = arapp.environments[environment].daoFactory || process.
module.exports = async function(callback) {
// load networkId; will change with updated truffle
const networkPromise = new Promise((resolve, reject) => {
web3.version.getNetwork((err, network) => {
if (err) {
reject(err);
} else {
resolve(network);
}
})
})
const networkId = await networkPromise;
const networkId = await getNetworkId(web3)
console.log(`Deploying to networkId: ${networkId}`)
if (!ensAddr) {