From bd8961833ee2d414f222067eb5e36eafc1e9f79f Mon Sep 17 00:00:00 2001 From: zzq0826 <770166635@qq.com> Date: Thu, 25 Jan 2024 10:01:09 +0800 Subject: [PATCH] FailedRelayed tx support retry feature (#924) --- src/pages/bridge/components/TxTable/TxStatusButton.tsx | 4 ++-- src/pages/bridge/components/TxTable/index.tsx | 2 +- src/stores/utils.ts | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/bridge/components/TxTable/TxStatusButton.tsx b/src/pages/bridge/components/TxTable/TxStatusButton.tsx index 56017ef26..f08a2b4cd 100644 --- a/src/pages/bridge/components/TxTable/TxStatusButton.tsx +++ b/src/pages/bridge/components/TxTable/TxStatusButton.tsx @@ -111,7 +111,7 @@ const TxStatus = props => { } } - if ([TX_STATUS.Dropped, TX_STATUS.FailedRelayed, TX_STATUS.SentFailed, TX_STATUS.Skipped].includes(tx.txStatus)) { + if ([TX_STATUS.Dropped, TX_STATUS.SentFailed, TX_STATUS.Skipped].includes(tx.txStatus)) { return ( { return } - if (tx.txStatus === TX_STATUS.RelayedReverted) { + if (tx.txStatus === TX_STATUS.RelayedReverted || tx.txStatus === TX_STATUS.FailedRelayed) { return } diff --git a/src/pages/bridge/components/TxTable/index.tsx b/src/pages/bridge/components/TxTable/index.tsx index b9bdda611..1a67ccf3c 100644 --- a/src/pages/bridge/components/TxTable/index.tsx +++ b/src/pages/bridge/components/TxTable/index.tsx @@ -289,7 +289,7 @@ const TxRow = props => { href={generateExploreLink(NETWORKS[+!tx.isL1].explorer, tx.hash)} className="leading-normal flex-1" > - {truncateHash(tx.hash)} + {truncateHash(tx.replayTxHash || tx.hash)} diff --git a/src/stores/utils.ts b/src/stores/utils.ts index 485f9fa9c..0f5334a05 100644 --- a/src/stores/utils.ts +++ b/src/stores/utils.ts @@ -50,6 +50,7 @@ export interface Transaction { initiatedAt?: string txStatus?: number msgHash?: string + replayTxHash?: string } export const MAX_OFFSET_TIME = 30 * 60 * 1000 @@ -91,6 +92,7 @@ export const formatBackTxList = (backList, estimatedTimeMap) => { return { hash: tx.hash, + replayTxHash: tx.replay_tx_hash, fromBlockNumber: tx.block_number, toHash, toBlockNumber: tx.counterpart_chain_tx?.block_number,