Handle new IPFS hashes in proposal

This commit is contained in:
2018-04-02 18:19:22 +02:00
parent 4be696ea62
commit 869c4c0ae9
+8 -1
View File
@@ -160,6 +160,13 @@ export default Service.extend({
return this.get('kreditsContract')
.then((contract) => contract.invoke('proposals', i))
.then(p => {
let ipfsHash = this.getMultihashFromBytes32({
digest: p[6],
hashFunction: p[7].toNumber(),
size: p[8].toNumber()
});
let proposal = Proposal.create({
id : i,
creatorAddress : p[0],
@@ -168,7 +175,7 @@ export default Service.extend({
votesNeeded : p[3].toNumber(),
amount : p[4].toNumber(),
executed : p[5],
ipfsHash : p[6]
ipfsHash : ipfsHash
});
if (proposal.get('ipfsHash')) {