Merge pull request #28 from 67P/refactor/proposal-ipfs-hash

Handle new IPFS hashes in proposal
This commit was merged in pull request #28.
This commit is contained in:
2018-04-02 21:00:58 +02:00
committed by GitHub
+8 -1
View File
@@ -161,6 +161,13 @@ export default Service.extend({
return this.get('kreditsContract') return this.get('kreditsContract')
.then((contract) => contract.invoke('proposals', i)) .then((contract) => contract.invoke('proposals', i))
.then(p => { .then(p => {
let ipfsHash = this.getMultihashFromBytes32({
digest: p[6],
hashFunction: p[7].toNumber(),
size: p[8].toNumber()
});
let proposal = Proposal.create({ let proposal = Proposal.create({
id : i, id : i,
creatorAddress : p[0], creatorAddress : p[0],
@@ -169,7 +176,7 @@ export default Service.extend({
votesNeeded : p[3].toNumber(), votesNeeded : p[3].toNumber(),
amount : p[4].toNumber(), amount : p[4].toNumber(),
executed : p[5], executed : p[5],
ipfsHash : p[6] ipfsHash : ipfsHash
}); });
if (proposal.get('ipfsHash')) { if (proposal.get('ipfsHash')) {