Pin reimbursements
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Release Drafter / Update release notes draft (pull_request) Successful in 3s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Release Drafter / Update release notes draft (pull_request) Successful in 3s
				
			This commit is contained in:
		
							parent
							
								
									3c7bcf038e
								
							
						
					
					
						commit
						83b3045afd
					
				| @ -29,8 +29,7 @@ class IpfsPinner { | ||||
|     const contracts = [ | ||||
|       this.kredits.Contributor, | ||||
|       this.kredits.Contribution, | ||||
|       // TODO uncomment once we have data here
 | ||||
|       // this.kredits.Reimbursement
 | ||||
|       this.kredits.Reimbursement | ||||
|     ] | ||||
| 
 | ||||
|     for (const contract of contracts) { | ||||
| @ -72,6 +71,11 @@ class IpfsPinner { | ||||
|         .then(data => { return this.ipfsApi.pin(data); }) | ||||
|         .then(callback); | ||||
|     }); | ||||
|     this.kredits.Reimbursement.on('ReimbursementAdded', (id) => { | ||||
|       this.kredits.Reimbursement.getData(id) | ||||
|         .then(data => { return this.ipfsApi.pin(data); }) | ||||
|         .then(callback); | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   async _pinAllFromContract (contract, itemCount, progressBar) { | ||||
| @ -91,7 +95,7 @@ class IpfsPinner { | ||||
|         cid = await ipfsApi.pin(data); | ||||
|         debug(`Pinned ${contract.constructor.name} #${id} at ${cid}`); | ||||
|       } catch(e) { | ||||
|         debug(`Error while trying to load an pin ${contract.constructor.name} #${id}:`) | ||||
|         debug(`Error while trying to load and pin ${contract.constructor.name} #${id}:`) | ||||
|         debug(e); | ||||
|         debug(`\nTrying again...`); | ||||
|         loadAndPin(id); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user