From 3e178bd95a0272d71717d91e7c5054ddfb386d61 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 13 Jun 2019 18:14:21 +0200 Subject: [PATCH] Fix seeds script to support new web3 version --- scripts/seeds.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/seeds.js b/scripts/seeds.js index 7115ae2..92fb357 100644 --- a/scripts/seeds.js +++ b/scripts/seeds.js @@ -17,13 +17,16 @@ module.exports = async function(callback) { let fundingAmount = 2; each(seeds.funds, (address, next) => { console.log(`funding ${address} with 2 ETH`); - web3.eth.sendTransaction({ - to: address, - value: web3.toWei(fundingAmount), - from: web3.eth.accounts[0] - }, - (result) => { next(); } - ) + try { + web3.eth.personal.getAccounts().then(accounts => { + web3.eth.personal.sendTransaction({ + to: address, + from: accounts[0], + value: web3.utils.toWei(new web3.utils.BN(fundingAmount)) + }); + }); + } catch(e) { console.log(e); process.exit() } + next(); }); each(seeds.contractCalls, (call, next) => {