diff --git a/packages/arb-token-bridge-ui/src/state/app/state.ts b/packages/arb-token-bridge-ui/src/state/app/state.ts index 4488f5b321..d233653fde 100644 --- a/packages/arb-token-bridge-ui/src/state/app/state.ts +++ b/packages/arb-token-bridge-ui/src/state/app/state.ts @@ -69,6 +69,8 @@ export interface MergedTransaction { } export interface TeleporterMergedTransaction extends MergedTransaction { + /** note: in contrast to general deposits which use `parentToChildMsgData`, + * Teleport transfers still follow L1/L2/L3 terminology, so we have `l1ToL2MsgData` and `l2ToL3MsgData` */ l1ToL2MsgData?: ParentToChildMessageData l2ToL3MsgData: L2ToL3MessageData } diff --git a/packages/arb-token-bridge-ui/src/state/app/utils.ts b/packages/arb-token-bridge-ui/src/state/app/utils.ts index 85de76102f..b65736ca78 100644 --- a/packages/arb-token-bridge-ui/src/state/app/utils.ts +++ b/packages/arb-token-bridge-ui/src/state/app/utils.ts @@ -63,17 +63,20 @@ export const getDepositStatus = ( } if (isTeleportTx(tx)) { - const { l2ToL3MsgData, parentToChildMsgData } = tx + /** note: in contrast to general deposits which use `parentToChildMsgData`, + * Teleport transfers still follow L1/L2/L3 terminology, so we have `l1ToL2MsgData` and `l2ToL3MsgData` */ + + const { l1ToL2MsgData, l2ToL3MsgData } = tx // if any of the retryable info is missing, first fetch might be pending - if (!parentToChildMsgData || !l2ToL3MsgData) return DepositStatus.L2_PENDING + if (!l1ToL2MsgData || !l2ToL3MsgData) return DepositStatus.L2_PENDING // if we find `l2ForwarderRetryableTxID` then this tx will need to be redeemed if (l2ToL3MsgData.l2ForwarderRetryableTxID) return DepositStatus.L2_FAILURE // if we find first retryable leg failing, then no need to check for the second leg const firstLegDepositStatus = getDepositStatusFromL1ToL2MessageStatus( - parentToChildMsgData.status + l1ToL2MsgData.status ) if (firstLegDepositStatus !== DepositStatus.L2_SUCCESS) { return firstLegDepositStatus @@ -85,13 +88,11 @@ export const getDepositStatus = ( if (typeof secondLegDepositStatus !== 'undefined') { return secondLegDepositStatus } - switch (parentToChildMsgData.status) { + switch (l1ToL2MsgData.status) { case ParentToChildMessageStatus.REDEEMED: return DepositStatus.L2_PENDING // tx is still pending if `l1ToL2MsgData` is redeemed (but l2ToL3MsgData is not) default: - return getDepositStatusFromL1ToL2MessageStatus( - parentToChildMsgData.status - ) + return getDepositStatusFromL1ToL2MessageStatus(l1ToL2MsgData.status) } } @@ -172,6 +173,7 @@ export const transformDeposit = ( if (isTeleportTx(tx)) { return { ...transaction, + l1ToL2MsgData: tx.l1ToL2MsgData, l2ToL3MsgData: tx.l2ToL3MsgData } } diff --git a/packages/arb-token-bridge-ui/src/types/Transactions.ts b/packages/arb-token-bridge-ui/src/types/Transactions.ts index 8fa341fa26..a654a5b5ac 100644 --- a/packages/arb-token-bridge-ui/src/types/Transactions.ts +++ b/packages/arb-token-bridge-ui/src/types/Transactions.ts @@ -75,6 +75,10 @@ export interface Transaction extends TransactionBase { } export interface TeleporterTransaction extends Transaction { + /** note: in contrast to general deposits which use `parentToChildMsgData`, + * Teleport transfers still follow L1/L2/L3 terminology, so we have `l1ToL2MsgData` and `l2ToL3MsgData` */ + + l1ToL2MsgData: ParentToChildMessageData l2ToL3MsgData: L2ToL3MessageData } diff --git a/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts b/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts index ad7f89ba80..525686feca 100644 --- a/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts +++ b/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts @@ -113,7 +113,7 @@ export const l1L2RetryableRequiresRedeem = ( tx: TeleporterMergedTransaction ) => { return ( - tx.parentToChildMsgData?.status === + tx.l1ToL2MsgData?.status === ParentToChildMessageStatus.FUNDS_DEPOSITED_ON_CHILD ) } diff --git a/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts b/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts index bdd6cc93ec..105f5f8439 100644 --- a/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts +++ b/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts @@ -99,7 +99,7 @@ export const updateAdditionalDepositData = async ( ...depositTx, status, timestampResolved, - parentToChildMsgData: l1ToL2MsgData, + l1ToL2MsgData, l2ToL3MsgData } }