Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Oct 8, 2024
1 parent ebb974f commit 84f1d2e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
PRIVATE_KEY_CUSTOM: ${{ secrets.E2E_PRIVATE_KEY }}
PRIVATE_KEY_USER: ${{ secrets.E2E_PRIVATE_KEY_USER }}
PRIVATE_KEY_CCTP: ${{ secrets.E2E_PRIVATE_KEY_CCTP }}
NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN: ${{ matrix.build-type == 'orbit-custom' && 'true' || 'false' }}
E2E_ORBIT_CUSTOM_GAS_TOKEN: ${{ matrix.test.type == 'orbit-custom' && 'true' || 'false' }}
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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:e2e": "yarn workspace arb-token-bridge-ui env-cmd --silent --file .e2e.env yarn synpress run --configFile synpress.config.ts",
"test:e2e:cctp": "yarn test:e2e --configFile synpress.cctp.config.ts",
"test:e2e:orbit": "E2E_ORBIT=true yarn test:e2e",
"test:e2e:orbit:custom-gas-token": "NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN=true yarn test:e2e"
"test:e2e:orbit:custom-gas-token": "E2E_ORBIT_CUSTOM_GAS_TOKEN=true yarn test:e2e"
},
"resolutions": {
"**/@walletconnect/ethereum-provider": "2.13.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/arb-token-bridge-ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = {
distDir: 'build',
productionBrowserSourceMaps: true,
reactStrictMode: true,
env: {
NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN:
process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN
},
// env: {
// NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN:
// process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN
// },
async headers() {
return [
{
Expand Down
5 changes: 3 additions & 2 deletions packages/arb-token-bridge-ui/src/util/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,16 @@ export const localL3NetworkRpcUrl = loadEnvironmentVariableWithFallback({
fallback: 'http://127.0.0.1:3347'
})

export async function registerLocalNetwork() {
export async function registerLocalNetwork(isCustomGasToken = false) {
try {
rpcURLs[defaultL1Network.chainId] = localL1NetworkRpcUrl
rpcURLs[defaultL2Network.chainId] = localL2NetworkRpcUrl
rpcURLs[defaultL3Network.chainId] = localL3NetworkRpcUrl

registerCustomArbitrumNetwork(defaultL2Network)
registerCustomArbitrumNetwork(
process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true'
process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true' ||
isCustomGasToken
? defaultL3CustomGasTokenNetwork
: defaultL3Network
)
Expand Down
14 changes: 10 additions & 4 deletions packages/arb-token-bridge-ui/synpress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const tests = process.env.TEST_FILE

const isOrbitTest = [
process.env.E2E_ORBIT,
process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN
process.env.E2E_ORBIT_CUSTOM_GAS_TOKEN
].includes('true')
const shouldRecordVideo = process.env.CYPRESS_RECORD_VIDEO === 'true'

Expand All @@ -70,7 +70,13 @@ export default defineConfig({
e2e: {
async setupNodeEvents(on, config) {
logsPrinter(on)
await registerLocalNetwork()
console.log(
'process.env.E2E_ORBIT_CUSTOM_GAS_TOKEN: ',
process.env.E2E_ORBIT_CUSTOM_GAS_TOKEN
)
await registerLocalNetwork(
process.env.E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true'
)

if (!ethRpcUrl && !isOrbitTest) {
throw new Error('NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL variable missing.')
Expand Down Expand Up @@ -196,7 +202,7 @@ export default defineConfig({
checkForAssertions({
parentProvider,
testType:
process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true'
process.env.E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true'
? 'orbit-custom'
: process.env.E2E_ORBIT === 'true'
? 'orbit-eth'
Expand Down Expand Up @@ -292,7 +298,7 @@ if (!process.env.PRIVATE_KEY_USER) {
}

const localWallet = new Wallet(
process.env.NEXT_PUBLIC_E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true'
process.env.E2E_ORBIT_CUSTOM_GAS_TOKEN === 'true'
? utils.sha256(utils.toUtf8Bytes('user_fee_token_deployer'))
: process.env.PRIVATE_KEY_CUSTOM
)
Expand Down

0 comments on commit 84f1d2e

Please sign in to comment.