Unify Contributor/Proposal saving
This commit is contained in:
@@ -53,15 +53,13 @@ export default class Contributor extends Base {
|
||||
Object.assign(attributes, this.decodeIpfsHash(ipfsHash));
|
||||
return attributes;
|
||||
})
|
||||
.then((attributes) => {
|
||||
let { address, digest, hashFunction, hashSize, isCore } = attributes;
|
||||
|
||||
.then((attr) => {
|
||||
let contributor = [
|
||||
address,
|
||||
digest,
|
||||
hashFunction,
|
||||
hashSize,
|
||||
isCore,
|
||||
attr.address,
|
||||
attr.ipfsHash,
|
||||
attr.hashFunction,
|
||||
attr.hashSize,
|
||||
attr.isCore,
|
||||
];
|
||||
|
||||
console.log('[kredits] addContributor', ...contributor);
|
||||
|
||||
@@ -56,12 +56,13 @@ export default class Operator extends Base {
|
||||
})
|
||||
.then((attr) => {
|
||||
let proposal = [
|
||||
parseInt(attr.recipientId),
|
||||
parseInt(attr.amount),
|
||||
attr.recipientId,
|
||||
attr.amount,
|
||||
attr.ipfsHash,
|
||||
attr.hashFunction,
|
||||
attr.hashSize,
|
||||
];
|
||||
|
||||
console.log('[kredits] addProposal', ...proposal);
|
||||
return this.contract.functions.addProposal(...proposal);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user