Skip to content

Commit

Permalink
revive
Browse files Browse the repository at this point in the history
  • Loading branch information
fionnachan committed Oct 21, 2024
1 parent bc449af commit f72375c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/arb-token-bridge-ui/src/util/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ export function mapCustomChainToNetworkData(chain: ChainWithRpcUrl) {
explorerUrls[chain.chainId] = chain.explorerUrl
}

function isArbitrumChain(
chain: NonArbParentNetwork | ArbitrumNetwork
): chain is ArbitrumNetwork {
return typeof (chain as ArbitrumNetwork).parentChainId !== 'undefined'
}

function isNonArbParentChain(chain: {
chainId: number
}): chain is NonArbParentNetwork {
Expand Down Expand Up @@ -578,8 +584,7 @@ export function getDestinationChainIds(chainId: ChainId): ChainId[] {
return []
}

const parentChainId =
'parentChainId' in chain ? chain.parentChainId : undefined
const parentChainId = isArbitrumChain(chain) ? chain.parentChainId : undefined

const validDestinationChainIds = getChildChainIds(chain)

Expand Down

0 comments on commit f72375c

Please sign in to comment.