Fix seeds script to support new web3 version

This commit is contained in:
bumi 2019-06-13 18:14:21 +02:00
parent 2e933d3989
commit 3e178bd95a

View File

@ -17,13 +17,16 @@ module.exports = async function(callback) {
let fundingAmount = 2; let fundingAmount = 2;
each(seeds.funds, (address, next) => { each(seeds.funds, (address, next) => {
console.log(`funding ${address} with 2 ETH`); console.log(`funding ${address} with 2 ETH`);
web3.eth.sendTransaction({ try {
to: address, web3.eth.personal.getAccounts().then(accounts => {
value: web3.toWei(fundingAmount), web3.eth.personal.sendTransaction({
from: web3.eth.accounts[0] to: address,
}, from: accounts[0],
(result) => { next(); } value: web3.utils.toWei(new web3.utils.BN(fundingAmount))
) });
});
} catch(e) { console.log(e); process.exit() }
next();
}); });
each(seeds.contractCalls, (call, next) => { each(seeds.contractCalls, (call, next) => {