cleanup
This commit is contained in:
@@ -26,7 +26,7 @@ export default Controller.extend({
|
|||||||
return this.get('model.proposals')
|
return this.get('model.proposals')
|
||||||
.map((proposal) => {
|
.map((proposal) => {
|
||||||
let contributor = this.get('contributors')
|
let contributor = this.get('contributors')
|
||||||
.findBy('id', proposal.get('recipientId').toString());
|
.findBy('id', proposal.get('recipientId'));
|
||||||
|
|
||||||
proposal.set('contributor', contributor);
|
proposal.set('contributor', contributor);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Base from './base';
|
|||||||
|
|
||||||
export default class Contributor extends Base {
|
export default class Contributor extends Base {
|
||||||
all() {
|
all() {
|
||||||
return this.contract.functions.contributorsCount()
|
return this.functions.contributorsCount()
|
||||||
.then((count) => {
|
.then((count) => {
|
||||||
count = count.toNumber();
|
count = count.toNumber();
|
||||||
let contributors = [];
|
let contributors = [];
|
||||||
@@ -24,7 +24,7 @@ export default class Contributor extends Base {
|
|||||||
getById(id) {
|
getById(id) {
|
||||||
id = ethers.utils.bigNumberify(id);
|
id = ethers.utils.bigNumberify(id);
|
||||||
|
|
||||||
return this.contract.functions.getContributorById(id)
|
return this.functions.getContributorById(id)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
// TODO: remove as soon as the contract provides the id
|
// TODO: remove as soon as the contract provides the id
|
||||||
data.id = id;
|
data.id = id;
|
||||||
@@ -55,7 +55,7 @@ export default class Contributor extends Base {
|
|||||||
];
|
];
|
||||||
|
|
||||||
console.log('[kredits] addContributor', ...contributor);
|
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 {
|
export default class Operator extends Base {
|
||||||
all() {
|
all() {
|
||||||
return this.contract.functions.proposalsCount()
|
return this.functions.proposalsCount()
|
||||||
.then((count) => {
|
.then((count) => {
|
||||||
count = count.toNumber();
|
count = count.toNumber();
|
||||||
let proposals = [];
|
let proposals = [];
|
||||||
@@ -24,7 +24,7 @@ export default class Operator extends Base {
|
|||||||
getById(id) {
|
getById(id) {
|
||||||
id = ethers.utils.bigNumberify(id);
|
id = ethers.utils.bigNumberify(id);
|
||||||
|
|
||||||
return this.contract.functions.proposals(id)
|
return this.functions.proposals(id)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
// TODO: remove as soon as the contract provides the id
|
// TODO: remove as soon as the contract provides the id
|
||||||
data.id = id;
|
data.id = id;
|
||||||
@@ -55,7 +55,7 @@ export default class Operator extends Base {
|
|||||||
];
|
];
|
||||||
|
|
||||||
console.log('[kredits] addProposal', ...proposal);
|
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;
|
this._config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
catAndMerge(data, deserializer) {
|
catAndMerge(data, deserialize) {
|
||||||
// if no hash details are found simply return the data; nothing to merge
|
// if no hash details are found simply return the data; nothing to merge
|
||||||
if (!data.hashSize || data.hashSize === 0) {
|
if (!data.hashSize || data.hashSize === 0) {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
return this.cat(data)
|
return this.cat(data)
|
||||||
.then(deserializer)
|
.then(deserialize)
|
||||||
.then((attributes) => {
|
.then((attributes) => {
|
||||||
return Object.assign({}, data, attributes);
|
return Object.assign({}, data, attributes);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user