Allow funding accounts with the seeds script

This commit is contained in:
bumi 2018-04-23 13:43:35 +02:00
parent 62a5cefd1a
commit 847f5a251c
2 changed files with 17 additions and 1 deletions

View File

@ -6,4 +6,8 @@ let contractCalls = [
['Operator', 'addProposal', [{contributorId: 3, amount: 100, kind: 'code', description: 'hacks on kredits', url: '' }, {gasLimit: 350000}]], ['Operator', 'addProposal', [{contributorId: 3, amount: 100, kind: 'code', description: 'hacks on kredits', url: '' }, {gasLimit: 350000}]],
['Operator', 'vote', ['1', {gasLimit: 250000}]] ['Operator', 'vote', ['1', {gasLimit: 250000}]]
]; ];
module.exports = { contractCalls }; let funds = [
'0x7e8f313c56f809188313aa274fa67ee58c31515d',
'0xa502eb4021f3b9ab62f75b57a94e1cfbf81fd827'
];
module.exports = { contractCalls, funds };

View File

@ -17,6 +17,18 @@ module.exports = function(callback) {
); );
const kredits = await Kredits.setup(provider, provider.getSigner()); const kredits = await Kredits.setup(provider, provider.getSigner());
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(); }
)
});
each(seeds.contractCalls, (call, next) => { each(seeds.contractCalls, (call, next) => {
let [contractName, method, args] = call; let [contractName, method, args] = call;
let contractWrapper = kredits[contractName]; let contractWrapper = kredits[contractName];