Skip to content

Commit

Permalink
feat: dont include all chains in e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanshparashar committed Dec 17, 2024
1 parent 9cacd2d commit a76bbe8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 9 additions & 1 deletion packages/arb-token-bridge-ui/src/util/orbitChainsList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NativeCurrencyBase } from '../hooks/useNativeCurrency'
import { ChainWithRpcUrl } from './networks'
import { ChainWithRpcUrl, ChainId } from './networks'
import orbitChainsData from './orbitChainsData.json'
import { isTestingEnvironment } from './CommonUtils'

export type NetworkType =
| 'Ethereum'
Expand Down Expand Up @@ -59,6 +60,13 @@ export function getOrbitChains(
testnet: boolean
} = { mainnet: true, testnet: true }
): OrbitChainConfig[] {
if (isTestingEnvironment) {
// During E2E tests, only return local chains
return Object.values(orbitChains).filter(
chain => chain.chainId === ChainId.L3Local
)
}

const mainnetChains = mainnet ? Object.values(orbitMainnets) : []
const testnetChains = testnet ? Object.values(orbitTestnets) : []

Expand Down
9 changes: 2 additions & 7 deletions packages/arb-token-bridge-ui/src/util/wagmi/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ const defaultChains = [

const chainList = isTestingEnvironment
? [
...defaultChains,
// Orbit chains
...wagmiOrbitChains,
// add local environments during testing
// only include local environments during testing
local,
arbitrumLocal,
l3Local,
// user-added custom chains
...customChains
l3Local
]
: [...defaultChains, ...wagmiOrbitChains, ...customChains]

Expand Down

0 comments on commit a76bbe8

Please sign in to comment.