Fix proposal wrapper to support the latest contracts
This commit is contained in:
parent
dfa55516ec
commit
f9ab8b225a
@ -4,7 +4,7 @@ const RSVP = require('rsvp');
|
|||||||
const ContributionSerializer = require('../serializers/contribution');
|
const ContributionSerializer = require('../serializers/contribution');
|
||||||
const Base = require('./base');
|
const Base = require('./base');
|
||||||
|
|
||||||
class Operator extends Base {
|
class Proposal extends Base {
|
||||||
all() {
|
all() {
|
||||||
return this.functions.proposalsCount()
|
return this.functions.proposalsCount()
|
||||||
.then((count) => {
|
.then((count) => {
|
||||||
@ -23,12 +23,6 @@ class Operator extends Base {
|
|||||||
id = ethers.utils.bigNumberify(id);
|
id = ethers.utils.bigNumberify(id);
|
||||||
|
|
||||||
return this.functions.getProposal(id)
|
return this.functions.getProposal(id)
|
||||||
.then((data) => {
|
|
||||||
// TODO: remove when naming updated on the contract
|
|
||||||
data.hashDigest = data.ipfsHash;
|
|
||||||
return data;
|
|
||||||
})
|
|
||||||
// Fetch IPFS data if available
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return this.ipfs.catAndMerge(data, ContributionSerializer.deserialize);
|
return this.ipfs.catAndMerge(data, ContributionSerializer.deserialize);
|
||||||
});
|
});
|
||||||
@ -54,4 +48,4 @@ class Operator extends Base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Operator;
|
module.exports = Proposal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user