Pin reimbursement data

This commit is contained in:
Râu Cao 2022-11-01 16:36:58 +01:00
parent 3c02591061
commit 77c2cea4a4
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -18,12 +18,12 @@ class IpfsPinner {
} }
async pinAll () { async pinAll () {
const contributorHashes = await this._pinAllFromContract(this.kredits.Contributor); const contributorHashes = await this._pinAllFromContract(this.kredits.Contributor);
const contributionHashes = await this._pinAllFromContract(this.kredits.Contribution); const contributionHashes = await this._pinAllFromContract(this.kredits.Contribution);
// const proposalHashes = await this._pinAllFromContract(this.kredits.Proposal); const reimbursementHashes = await this._pinAllFromContract(this.kredits.Reimbursement);
return contributorHashes.concat(contributionHashes); return contributorHashes.concat(contributionHashes)
// .concat(proposalHashes); .concat(reimbursementHashes);
} }
monitor (callback) { monitor (callback) {
@ -52,7 +52,7 @@ class IpfsPinner {
const cids = []; const cids = [];
async function loadAndPin (id) { async function loadAndPin (id) {
debug(`Loading ${contract.constructor.name} #${id}`); debug(`Loading ${contract.constructor.name} #${id}`);
return contract.getData(id).then(data => { return contract.getData(id).then(data => {
debug(`Pinning ${contract.constructor.name} #${id}`); debug(`Pinning ${contract.constructor.name} #${id}`);
return this.ipfsApi.pin(data).then(cid => cids.push(cid)); return this.ipfsApi.pin(data).then(cid => cids.push(cid));