Skip to content

Commit

Permalink
chore: normalize case txhash for finding tx
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Jun 12, 2024
1 parent 97e7440 commit ffd3cb0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/libs/TransactionRecoveryApi/AxelarRecoveryApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -228,6 +229,8 @@ export class AxelarRecoveryApi {
): Promise<GMPStatusResponse> {
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 } =
Expand Down

0 comments on commit ffd3cb0

Please sign in to comment.