fix: set status confirmed
This commit is contained in:
parent
2bf6fc79d7
commit
005951cf5f
@ -48,13 +48,6 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
|
|||||||
await job.update(job.data);
|
await job.update(job.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnQueueCompleted()
|
|
||||||
async onCompleted(job: Job) {
|
|
||||||
job.data.status = 'CONFIRMED';
|
|
||||||
|
|
||||||
await job.update(job.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnQueueFailed()
|
@OnQueueFailed()
|
||||||
async onFailed(job: Job) {
|
async onFailed(job: Job) {
|
||||||
job.data.status = 'FAILED';
|
job.data.status = 'FAILED';
|
||||||
@ -89,6 +82,10 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (BigNumber.from(receipt.status).eq(1)) {
|
if (BigNumber.from(receipt.status).eq(1)) {
|
||||||
|
job.data.status = 'CONFIRMED';
|
||||||
|
|
||||||
|
await job.update(job.data);
|
||||||
|
|
||||||
return receipt.transactionHash;
|
return receipt.transactionHash;
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Submitted transaction failed');
|
throw new Error('Submitted transaction failed');
|
||||||
|
Loading…
Reference in New Issue
Block a user