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));
|
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);
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user