This commit is contained in:
Danil Kovtonyuk 2021-10-01 16:07:19 +10:00
parent 005951cf5f
commit ded50dc62b
No known key found for this signature in database
GPG Key ID: E72A919BF08C3746

View File

@ -48,6 +48,12 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
await job.update(job.data);
}
@OnQueueCompleted()
async onCompleted(job: Job) {
job.data.status = 'CONFIRMED';
await job.update(job.data);
}
@OnQueueFailed()
async onFailed(job: Job) {
job.data.status = 'FAILED';
@ -82,10 +88,6 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
});
if (BigNumber.from(receipt.status).eq(1)) {
job.data.status = 'CONFIRMED';
await job.update(job.data);
return receipt.transactionHash;
} else {
throw new Error('Submitted transaction failed');