Return IPFS hash in addContribution() response

Needed in kredits-web. Useful for clients to identify contributions
before knowing their assigned ID.
This commit is contained in:
Basti 2019-09-10 12:18:35 +02:00
parent 1c1a318ae6
commit a7c497da6a
No known key found for this signature in database
GPG Key ID: BE4634D632D39B67

View File

@ -58,7 +58,10 @@ class Contribution extends Record {
ipfsHashAttr.hashSize, ipfsHashAttr.hashSize,
]; ];
return this.functions.add(...contribution, callOptions); return this.functions.add(...contribution, callOptions).then(res => {
res.ipfsHash = this.ipfs.encodeHash(ipfsHashAttr);
return res;
});
}); });
} }