fix: set status confirmed

This commit is contained in:
Danil Kovtonyuk 2021-10-01 14:30:14 +10:00
parent 2bf6fc79d7
commit 005951cf5f
No known key found for this signature in database
GPG Key ID: E72A919BF08C3746

View File

@ -48,13 +48,6 @@ 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';
@ -89,6 +82,10 @@ 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');