From ed0d420fd527a8add6b395a29fcb2f73702ac6d0 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 13 Jun 2019 17:37:36 +0200 Subject: [PATCH 1/4] Fix linter issues in seeds --- config/seeds.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/seeds.js b/config/seeds.js index a70f142..ceb26b5 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -7,7 +7,7 @@ const contractCalls = [ github_username: 'bumi', github_uid: 318, gitea_username: 'bumi', - wiki_username: 'Bumi' + wiki_username: 'Bumi', }, { gasLimit: 200000 }]], ['Contributor', 'add', [{ @@ -18,7 +18,7 @@ const contractCalls = [ github_username: 'skddc', github_uid: 842, gitea_username: 'raucao', - wiki_username: 'Basti' + wiki_username: 'Basti', }, { gasLimit: 200000 }]], ['Contributor', 'add', [{ @@ -28,7 +28,7 @@ const contractCalls = [ url: '', github_username: 'fsmanuel', github_uid: 54812, - wiki_username: 'Manuel' + wiki_username: 'Manuel', }, { gasLimit: 200000 }]], ['Proposal', 'addProposal', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], @@ -42,7 +42,7 @@ const contractCalls = [ const funds = [ '0x7e8f313c56f809188313aa274fa67ee58c31515d', - '0xa502eb4021f3b9ab62f75b57a94e1cfbf81fd827' + '0xa502eb4021f3b9ab62f75b57a94e1cfbf81fd827', ]; module.exports = { contractCalls, funds }; -- 2.25.1 From 2623e71055d72deb266166ae12ad7114cab67f98 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 13 Jun 2019 17:38:00 +0200 Subject: [PATCH 2/4] Update deprecated functions in seeds --- config/seeds.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/seeds.js b/config/seeds.js index ceb26b5..22c59ee 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -31,13 +31,13 @@ const contractCalls = [ wiki_username: 'Manuel', }, { gasLimit: 200000 }]], - ['Proposal', 'addProposal', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], - ['Proposal', 'addProposal', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-10', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], - ['Proposal', 'addProposal', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Hacked on kredits', url: '' }, { gasLimit: 350000 }]], + ['Proposal', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], + ['Proposal', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-10', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], + ['Proposal', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Hacked on kredits', url: '' }, { gasLimit: 350000 }]], ['Proposal', 'vote', [1, { gasLimit: 550000 }]], - ['Contribution', 'addContribution', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], - ['Contribution', 'addContribution', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]], - ['Contribution', 'claim', [1, { gasLimit: 300000 }]] + ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], + ['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]], + ['Contribution', 'claim', [1, { gasLimit: 300000 }]], ]; const funds = [ -- 2.25.1 From 6c8491e67b1353ff51f5b88a1276881e1f6710e4 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 13 Jun 2019 17:38:34 +0200 Subject: [PATCH 3/4] Handle errors in seed funding --- scripts/seeds.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/seeds.js b/scripts/seeds.js index 7115ae2..027e3dd 100644 --- a/scripts/seeds.js +++ b/scripts/seeds.js @@ -17,13 +17,15 @@ 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.sendTransaction({ + to: address, + value: web3.toWei(fundingAmount), + from: web3.eth.accounts[0] + }, result => next()) + } catch(e) { + console.log('FAILED:', e); + } }); each(seeds.contractCalls, (call, next) => { -- 2.25.1 From b7d87cd8f2df54ba1c9d2d0c22dba24d557c2e5d Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 13 Jun 2019 17:39:03 +0200 Subject: [PATCH 4/4] Ignore scripts folder in eslint Lots of undef etc. due to the scripts being piped through truffle --- .eslintignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..6633896 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +/scripts/ -- 2.25.1