fix: callback return value

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

View File

@ -33,9 +33,9 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
const { extData } = job.data;
await this.checkFee({ fee: extData.fee, externalAmount: extData.extAmount });
await this.submitTx(job);
const txHash = await this.submitTx(job);
cb(null);
cb(null, txHash);
} catch (err) {
cb(err);
}
@ -88,7 +88,9 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
await job.update(job.data);
});
if (receipt.status !== 1) {
if (BigNumber.from(receipt.status).eq(1)) {
return receipt.transactionHash;
} else {
throw new Error('Submitted transaction failed');
}
} catch (err) {