Skip to content

Commit

Permalink
Update arbitrum.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed May 20, 2024
1 parent 8f7c36f commit b5ea158
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/finalizer/utils/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b5ea158

Please sign in to comment.