Cleanup scripts and use helper to get the networkid
This commit is contained in:
@@ -2,23 +2,14 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const fileInject = require('./helpers/file_inject.js');
|
||||
const getNetworkId = require('./helpers/networkid.js');
|
||||
|
||||
const addressesPath = path.join(__dirname, '..', 'lib/addresses');
|
||||
|
||||
const KreditsKit = artifacts.require('KreditsKit')
|
||||
|
||||
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}`)
|
||||
|
||||
let kitAddresseFile = path.join(addressesPath, 'KreditsKit.json');
|
||||
|
||||
Reference in New Issue
Block a user