From ae24418de5083bb06e08ea52263a25a1ce9dfb90 Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Mon, 19 Aug 2024 10:30:05 +0200 Subject: [PATCH] Use RPC URLs from env in JS tests This makes sure we use the same configuration across all tests. --- op-e2e/celo/shared.sh | 4 ++-- op-e2e/celo/src/chain.js | 5 +++-- op-e2e/celo/test_npm.sh | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/op-e2e/celo/shared.sh b/op-e2e/celo/shared.sh index 2e6bbd0217e6..92e9be7be28e 100644 --- a/op-e2e/celo/shared.sh +++ b/op-e2e/celo/shared.sh @@ -1,8 +1,8 @@ #!/bin/bash #shellcheck disable=SC2034 # unused vars make sense in a shared file -export ETH_RPC_URL=http://127.0.0.1:9545 -export ETH_RPC_URL_L1=http://127.0.0.1:8545 +export ETH_RPC_URL=http://localhost:9545 +export ETH_RPC_URL_L1=http://localhost:8545 export ACC_PRIVKEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 ACC_ADDR=$(cast wallet address $ACC_PRIVKEY) diff --git a/op-e2e/celo/src/chain.js b/op-e2e/celo/src/chain.js index 43ed0c07e67d..6d5ec9e73ea5 100644 --- a/op-e2e/celo/src/chain.js +++ b/op-e2e/celo/src/chain.js @@ -2,6 +2,7 @@ import { chainConfig } from 'viem/op-stack' import { defineChain } from 'viem' export function makeChainConfigs(l1ChainID, l2ChainID, contractAddresses) { + console.log(process.env) return { l2: defineChain({ formatters: { @@ -19,7 +20,7 @@ export function makeChainConfigs(l1ChainID, l2ChainID, contractAddresses) { }, rpcUrls: { default: { - http: ['http://localhost:9545'], + http: [process.env.ETH_RPC_URL], }, }, contracts: { @@ -52,7 +53,7 @@ export function makeChainConfigs(l1ChainID, l2ChainID, contractAddresses) { }, rpcUrls: { default: { - http: ['http://localhost:8545'], + http: [process.env.ETH_RPC_URL_L1], }, }, contracts: { diff --git a/op-e2e/celo/test_npm.sh b/op-e2e/celo/test_npm.sh index bbb12d106441..89783597300c 100755 --- a/op-e2e/celo/test_npm.sh +++ b/op-e2e/celo/test_npm.sh @@ -1,4 +1,6 @@ #!/bin/bash +#shellcheck disable=SC1091 set -eo pipefail +source shared.sh npm test