From ffd3cb004cf180ee4541b6fec001e8c18825e344 Mon Sep 17 00:00:00 2001 From: npty Date: Wed, 12 Jun 2024 15:07:08 +0700 Subject: [PATCH] chore: normalize case txhash for finding tx --- .../TransactionRecoveryApi/AxelarRecoveryApi.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts index 215731bf..7123d6bd 100644 --- a/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts +++ b/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts @@ -151,12 +151,13 @@ export class AxelarRecoveryApi { txHash, txLogIndex, }) - .then((data) => - data.find( + .then((data) => { + return data.find( (gmpTx: any) => - gmpTx.id.indexOf(txHash) > -1 || gmpTx.call.transactionHash.indexOf(txHash) > -1 // the source transaction hash will be stored at "tx.call.transactionHash", if it is sent from cosmos, otherwise it'll be stored at `tx.id` field. - ) - ) + gmpTx.id.toLowerCase().indexOf(txHash.toLowerCase()) > -1 || + gmpTx.call.transactionHash.toLowerCase().indexOf(txHash.toLowerCase()) > -1 // the source transaction hash will be stored at "tx.call.transactionHash", if it is sent from cosmos, otherwise it'll be stored at `tx.id` field. + ); + }) .catch(() => undefined); } @@ -228,6 +229,8 @@ export class AxelarRecoveryApi { ): Promise { const txDetails = await this.fetchGMPTransaction(txHash, txLogIndex); + console.log(txDetails); + if (!txDetails) return { status: GMPStatus.CANNOT_FETCH_STATUS }; const { call, gas_status, gas_paid, executed, express_executed, approved, callback } =