From b5ea1582a346df9cbfe10d137934d093b13b7779 Mon Sep 17 00:00:00 2001 From: nicholaspai Date: Sun, 19 May 2024 21:19:59 -0400 Subject: [PATCH] Update arbitrum.ts --- src/finalizer/utils/arbitrum.ts | 34 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/finalizer/utils/arbitrum.ts b/src/finalizer/utils/arbitrum.ts index 955be1a45..e3e93f3e4 100644 --- a/src/finalizer/utils/arbitrum.ts +++ b/src/finalizer/utils/arbitrum.ts @@ -140,21 +140,25 @@ async function getAllMessageStatuses( // For each token bridge event, store a unique log index for the event within the arbitrum transaction hash. // This is important for bridge transactions containing multiple events. const logIndexesForMessage = getUniqueLogIndex(tokensBridged); - return await Promise.all( - tokensBridged.map((e, i) => getMessageOutboxStatusAndProof(logger, e, mainnetSigner, logIndexesForMessage[i])) - ) - .map((result, i) => { - return { - ...result, - info: tokensBridged[i], - }; - }) - // USDC withdrawals for Arbitrum should be finalized via the CCTP Finalizer. - .filter( - (result) => - result.message !== undefined && - !compareAddressesSimple(result.info.l2TokenAddress, TOKEN_SYMBOLS_MAP["_USDC"].addresses[CHAIN_ID]) - ); + return ( + ( + await Promise.all( + tokensBridged.map((e, i) => getMessageOutboxStatusAndProof(logger, e, mainnetSigner, logIndexesForMessage[i])) + ) + ) + .map((result, i) => { + return { + ...result, + info: tokensBridged[i], + }; + }) + // USDC withdrawals for Arbitrum should be finalized via the CCTP Finalizer. + .filter( + (result) => + result.message !== undefined && + !compareAddressesSimple(result.info.l2TokenAddress, TOKEN_SYMBOLS_MAP["_USDC"].addresses[CHAIN_ID]) + ) + ); } async function getMessageOutboxStatusAndProof(