Skip to content

Commit

Permalink
FailedRelayed tx support retry feature (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzq0826 authored Jan 25, 2024
1 parent 045d43a commit bd89618
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pages/bridge/components/TxTable/TxStatusButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Tooltip placement="top" title="Please click on the transaction hash to view the error reason.">
<Chip
Expand All @@ -130,7 +130,7 @@ const TxStatus = props => {
return <Chip className={cx(classes.chip, classes.successChip)} label="Success"></Chip>
}

if (tx.txStatus === TX_STATUS.RelayedReverted) {
if (tx.txStatus === TX_STATUS.RelayedReverted || tx.txStatus === TX_STATUS.FailedRelayed) {
return <ActiveButton type="Retry" tx={tx} />
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/bridge/components/TxTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
</Link>
</Typography>
</Stack>
Expand Down
2 changes: 2 additions & 0 deletions src/stores/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface Transaction {
initiatedAt?: string
txStatus?: number
msgHash?: string
replayTxHash?: string
}

export const MAX_OFFSET_TIME = 30 * 60 * 1000
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bd89618

Please sign in to comment.