cleanup
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user