Adjust proposals for format changes

This commit is contained in:
2019-04-04 23:11:43 +02:00
parent 181e6f3c23
commit a049f2eedb
3 changed files with 33 additions and 38 deletions

View File

@@ -7,8 +7,7 @@ const Base = require('./base');
class Proposal extends Base {
all() {
return this.functions.proposalsCount()
.then((count) => {
count = count.toNumber();
.then(count => {
let proposals = [];
for (let id = 1; id <= count; id++) {
@@ -20,10 +19,8 @@ class Proposal extends Base {
}
getById(id) {
id = ethers.utils.bigNumberify(id);
return this.functions.getProposal(id)
.then((data) => {
.then(data => {
return this.ipfs.catAndMerge(data, ContributionSerializer.deserialize);
});
}