From 4a711788f652b8f293ae7f8f2774b6f03a996692 Mon Sep 17 00:00:00 2001 From: bumi Date: Tue, 10 Apr 2018 15:27:38 +0200 Subject: [PATCH] cleanup --- app/controllers/index.js | 2 +- app/lib/kredits/contracts/contributor.js | 6 +++--- app/lib/kredits/contracts/operator.js | 6 +++--- app/lib/kredits/utils/ipfs.js | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/index.js b/app/controllers/index.js index 5b0727e..1f5ca43 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -26,7 +26,7 @@ export default Controller.extend({ return this.get('model.proposals') .map((proposal) => { let contributor = this.get('contributors') - .findBy('id', proposal.get('recipientId').toString()); + .findBy('id', proposal.get('recipientId')); proposal.set('contributor', contributor); diff --git a/app/lib/kredits/contracts/contributor.js b/app/lib/kredits/contracts/contributor.js index 4e859ff..3e8ab1e 100644 --- a/app/lib/kredits/contracts/contributor.js +++ b/app/lib/kredits/contracts/contributor.js @@ -8,7 +8,7 @@ import Base from './base'; export default class Contributor extends Base { all() { - return this.contract.functions.contributorsCount() + return this.functions.contributorsCount() .then((count) => { count = count.toNumber(); let contributors = []; @@ -24,7 +24,7 @@ export default class Contributor extends Base { getById(id) { id = ethers.utils.bigNumberify(id); - return this.contract.functions.getContributorById(id) + return this.functions.getContributorById(id) .then((data) => { // TODO: remove as soon as the contract provides the id data.id = id; @@ -55,7 +55,7 @@ export default class Contributor extends Base { ]; console.log('[kredits] addContributor', ...contributor); - return this.contract.functions.addContributor(...contributor); + return this.functions.addContributor(...contributor); }); } } diff --git a/app/lib/kredits/contracts/operator.js b/app/lib/kredits/contracts/operator.js index c62eb9c..5a98943 100644 --- a/app/lib/kredits/contracts/operator.js +++ b/app/lib/kredits/contracts/operator.js @@ -8,7 +8,7 @@ import Base from './base'; export default class Operator extends Base { all() { - return this.contract.functions.proposalsCount() + return this.functions.proposalsCount() .then((count) => { count = count.toNumber(); let proposals = []; @@ -24,7 +24,7 @@ export default class Operator extends Base { getById(id) { id = ethers.utils.bigNumberify(id); - return this.contract.functions.proposals(id) + return this.functions.proposals(id) .then((data) => { // TODO: remove as soon as the contract provides the id data.id = id; @@ -55,7 +55,7 @@ export default class Operator extends Base { ]; console.log('[kredits] addProposal', ...proposal); - return this.contract.functions.addProposal(...proposal); + return this.functions.addProposal(...proposal); }); } } diff --git a/app/lib/kredits/utils/ipfs.js b/app/lib/kredits/utils/ipfs.js index 9485c12..5a2a7e4 100644 --- a/app/lib/kredits/utils/ipfs.js +++ b/app/lib/kredits/utils/ipfs.js @@ -8,13 +8,13 @@ export default class IPFS { this._config = config; } - catAndMerge(data, deserializer) { + catAndMerge(data, deserialize) { // if no hash details are found simply return the data; nothing to merge if (!data.hashSize || data.hashSize === 0) { return data; } return this.cat(data) - .then(deserializer) + .then(deserialize) .then((attributes) => { return Object.assign({}, data, attributes); });