Skip to content

Commit

Permalink
Merge branch 'master' into fix-e2e-ci-no-list
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc authored Jan 14, 2025
2 parents a255b5a + 89e2762 commit 4b8c012
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 38 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
Expand All @@ -66,7 +66,7 @@ jobs:
run: |
wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_128.0.6613.137-1_amd64.deb
sudo apt-get install ./google-chrome-stable_128.0.6613.137-1_amd64.deb
- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -136,9 +136,9 @@ jobs:
PRIVATE_KEY_CCTP: ${{ secrets.E2E_PRIVATE_KEY_CCTP }}
NEXT_PUBLIC_IS_E2E_TEST: true
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL: http://127.0.0.1:8545
NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL: http://127.0.0.1:8547
NEXT_PUBLIC_LOCAL_L3_RPC_URL: http://127.0.0.1:3347
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1: http://127.0.0.1:8545
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2: http://127.0.0.1:8547
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3: http://127.0.0.1:3347

- name: Archive e2e artifacts
uses: actions/upload-artifact@v4
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Interested in contributing to this repo? We welcome your contribution.

4. For custom urls, set optional vars:

- `NEXT_PUBLIC_ETHEREUM_RPC_URL=my-eth-node`
- `NEXT_PUBLIC_SEPOLIA_RPC_URL=my-sepolia-node`
(see [.env.sample](./packages/arb-token-bridge-ui/.env.sample))
- `NEXT_PUBLIC_RPC_URL_ETHEREUM=my-eth-node`
- `NEXT_PUBLIC_RPC_URL_SEPOLIA=my-sepolia-node`
(see [.env.local.sample](./packages/arb-token-bridge-ui/.env.local.sample))
If no custom URL is provided, Infura will be used by default.

5. Build the project and internal packages
Expand Down
6 changes: 3 additions & 3 deletions packages/arb-token-bridge-ui/.e2e.env.sample
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
NEXT_PUBLIC_INFURA_KEY=
NETWORK_NAME=localhost

NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL=http://127.0.0.1:8545
NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL=http://127.0.0.1:8547
NEXT_PUBLIC_LOCAL_L3_RPC_URL=http://127.0.0.1:3347
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1=http://127.0.0.1:8545
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2=http://127.0.0.1:8547
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3=http://127.0.0.1:3347

CYPRESS_RECORD_VIDEO=false

Expand Down
27 changes: 20 additions & 7 deletions packages/arb-token-bridge-ui/.env.local.sample
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
# ----- Infura -----

# Default Infura key. If no network-specific keys are set, it will fallback to this key.
NEXT_PUBLIC_INFURA_KEY=

# L1
# L1 Mainnet
NEXT_PUBLIC_INFURA_KEY_ETHEREUM=

# L1 Testnet
NEXT_PUBLIC_INFURA_KEY_SEPOLIA=
NEXT_PUBLIC_INFURA_KEY_HOLESKY=

# L2
# L2 Mainnet
NEXT_PUBLIC_INFURA_KEY_ARBITRUM_ONE=
NEXT_PUBLIC_INFURA_KEY_BASE=

# L2 Testnet
NEXT_PUBLIC_INFURA_KEY_ARBITRUM_SEPOLIA=
NEXT_PUBLIC_INFURA_KEY_BASE_SEPOLIA=

NEXT_PUBLIC_SENTRY_DSN=
# ----- Custom RPCs -----

NEXT_PUBLIC_ETHEREUM_RPC_URL=
NEXT_PUBLIC_SEPOLIA_RPC_URL=
# L1 Mainnet
NEXT_PUBLIC_RPC_URL_ETHEREUM=

NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL="http://localhost:8545"
NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL="http://localhost:8547"
# L1 Testnet
NEXT_PUBLIC_RPC_URL_SEPOLIA=

# Nitro Testnode
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1="http://127.0.0.1:8545"
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2="http://127.0.0.1:8547"
NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3="http://127.0.0.1:3347"

# ----- Other -----

NEXT_PUBLIC_SENTRY_DSN=

NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Container = ({ children }: PropsWithChildren<unknown>) => (
)

const provider = new StaticJsonRpcProvider(
process.env.NEXT_PUBLIC_ETHEREUM_RPC_URL,
process.env.NEXT_PUBLIC_RPC_URL_ETHEREUM,
1
)
jest.mock('../../token-bridge-sdk/utils', () => ({
Expand Down
10 changes: 5 additions & 5 deletions packages/arb-token-bridge-ui/src/util/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ export const supportedCustomOrbitParentChains = [
export const rpcURLs: { [chainId: number]: string } = {
// L1
[ChainId.Ethereum]: loadEnvironmentVariableWithFallback({
env: process.env.NEXT_PUBLIC_ETHEREUM_RPC_URL,
env: process.env.NEXT_PUBLIC_RPC_URL_ETHEREUM,
fallback: chainIdToInfuraUrl(ChainId.Ethereum)
}),
// L1 Testnets
[ChainId.Sepolia]: loadEnvironmentVariableWithFallback({
env: process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL,
env: process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA,
fallback: chainIdToInfuraUrl(ChainId.Sepolia)
}),
[ChainId.Holesky]: 'https://ethereum-holesky-rpc.publicnode.com',
Expand Down Expand Up @@ -414,15 +414,15 @@ export const defaultL3CustomGasTokenNetwork: ArbitrumNetwork = {
}

export const localL1NetworkRpcUrl = loadEnvironmentVariableWithFallback({
env: process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL,
env: process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1,
fallback: 'http://127.0.0.1:8545'
})
export const localL2NetworkRpcUrl = loadEnvironmentVariableWithFallback({
env: process.env.NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL,
env: process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2,
fallback: 'http://127.0.0.1:8547'
})
export const localL3NetworkRpcUrl = loadEnvironmentVariableWithFallback({
env: process.env.NEXT_PUBLIC_LOCAL_L3_RPC_URL,
env: process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3,
fallback: 'http://127.0.0.1:3347'
})

Expand Down
8 changes: 6 additions & 2 deletions packages/arb-token-bridge-ui/src/util/wagmi/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { mainnet, arbitrum } from '@wagmi/core/chains'
import { publicProvider } from 'wagmi/providers/public'
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'
import { connectorsForWallets, getDefaultWallets } from '@rainbow-me/rainbowkit'
import { trustWallet, okxWallet } from '@rainbow-me/rainbowkit/wallets'
import {
trustWallet,
okxWallet,
rabbyWallet
} from '@rainbow-me/rainbowkit/wallets'

import {
sepolia,
Expand Down Expand Up @@ -178,7 +182,7 @@ export function getProps(targetChainKey: string | null) {
...wallets,
{
groupName: 'More',
wallets: [trustWallet({ chains, projectId })]
wallets: [trustWallet({ chains, projectId }), rabbyWallet({ chains })]
}
])

Expand Down
2 changes: 1 addition & 1 deletion packages/arb-token-bridge-ui/synpress.cctp.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (!process.env.PRIVATE_KEY_USER) {

const SEPOLIA_INFURA_RPC_URL = `https://sepolia.infura.io/v3/${INFURA_KEY}`
const sepoliaRpcUrl =
process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL ?? SEPOLIA_INFURA_RPC_URL
process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA ?? SEPOLIA_INFURA_RPC_URL
const arbSepoliaRpcUrl = 'https://sepolia-rollup.arbitrum.io/rpc'

const sepoliaProvider = new StaticJsonRpcProvider(sepoliaRpcUrl)
Expand Down
28 changes: 17 additions & 11 deletions packages/arb-token-bridge-ui/synpress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,23 @@ export default defineConfig({
const isCustomFeeToken = isNonZeroAddress(ethBridger.nativeToken)

if (!ethRpcUrl && !isOrbitTest) {
throw new Error('NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL variable missing.')
throw new Error(
'NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1 variable missing.'
)
}
if (!arbRpcUrl) {
throw new Error('NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL variable missing.')
throw new Error(
'NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2 variable missing.'
)
}
if (!l3RpcUrl && isOrbitTest) {
throw new Error('NEXT_PUBLIC_LOCAL_L3_RPC_URL variable missing.')
throw new Error(
'NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3 variable missing.'
)
}
if (!sepoliaRpcUrl) {
throw new Error(
'process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL variable missing.'
'process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA variable missing.'
)
}

Expand Down Expand Up @@ -246,19 +252,19 @@ const ethRpcUrl = (() => {
// For consistency purpose, we would be using 'custom-localhost'
// MetaMask auto-detects same rpc url and blocks adding new custom network with same rpc
// so we have to add a / to the end of the rpc url
if (!process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL) {
if (!process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1) {
return MAINNET_INFURA_RPC_URL
}
if (process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL.endsWith('/')) {
return process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL
if (process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1.endsWith('/')) {
return process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1
}
return process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL + '/'
return process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1 + '/'
})()

const arbRpcUrl = process.env.NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL
const l3RpcUrl = process.env.NEXT_PUBLIC_LOCAL_L3_RPC_URL
const arbRpcUrl = process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2
const l3RpcUrl = process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3
const sepoliaRpcUrl =
process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL ?? SEPOLIA_INFURA_RPC_URL
process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA ?? SEPOLIA_INFURA_RPC_URL
const arbSepoliaRpcUrl = 'https://sepolia-rollup.arbitrum.io/rpc'

const parentProvider = new StaticJsonRpcProvider(
Expand Down

0 comments on commit 4b8c012

Please sign in to comment.