Unify Contributor/Proposal saving

This commit is contained in:
2018-04-09 15:05:13 +02:00
parent ce8fef79dc
commit e9f0638ca2
2 changed files with 9 additions and 10 deletions
+6 -8
View File
@@ -53,15 +53,13 @@ export default class Contributor extends Base {
Object.assign(attributes, this.decodeIpfsHash(ipfsHash)); Object.assign(attributes, this.decodeIpfsHash(ipfsHash));
return attributes; return attributes;
}) })
.then((attributes) => { .then((attr) => {
let { address, digest, hashFunction, hashSize, isCore } = attributes;
let contributor = [ let contributor = [
address, attr.address,
digest, attr.ipfsHash,
hashFunction, attr.hashFunction,
hashSize, attr.hashSize,
isCore, attr.isCore,
]; ];
console.log('[kredits] addContributor', ...contributor); console.log('[kredits] addContributor', ...contributor);
+3 -2
View File
@@ -56,12 +56,13 @@ export default class Operator extends Base {
}) })
.then((attr) => { .then((attr) => {
let proposal = [ let proposal = [
parseInt(attr.recipientId), attr.recipientId,
parseInt(attr.amount), attr.amount,
attr.ipfsHash, attr.ipfsHash,
attr.hashFunction, attr.hashFunction,
attr.hashSize, attr.hashSize,
]; ];
console.log('[kredits] addProposal', ...proposal); console.log('[kredits] addProposal', ...proposal);
return this.contract.functions.addProposal(...proposal); return this.contract.functions.addProposal(...proposal);
}); });