From 86bbe49c0bdaa43d7cadc36a89847e62034ed134 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/seeds.js b/scripts/seeds.js index 027e3dd..8928419 100644 --- a/scripts/seeds.js +++ b/scripts/seeds.js @@ -18,14 +18,17 @@ module.exports = async function(callback) { each(seeds.funds, (address, next) => { console.log(`funding ${address} with 2 ETH`); try { - web3.eth.sendTransaction({ - to: address, - value: web3.toWei(fundingAmount), - from: web3.eth.accounts[0] - }, result => next()) + 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('FAILED:', e); } + next(); }); each(seeds.contractCalls, (call, next) => {