Skip to content

Commit

Permalink
Use RPC URLs from env in JS tests
Browse files Browse the repository at this point in the history
This makes sure we use the same configuration across all tests.
  • Loading branch information
karlb committed Aug 19, 2024
1 parent cb53122 commit ae24418
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions op-e2e/celo/shared.sh
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 3 additions & 2 deletions op-e2e/celo/src/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -19,7 +20,7 @@ export function makeChainConfigs(l1ChainID, l2ChainID, contractAddresses) {
},
rpcUrls: {
default: {
http: ['http://localhost:9545'],
http: [process.env.ETH_RPC_URL],
},
},
contracts: {
Expand Down Expand Up @@ -52,7 +53,7 @@ export function makeChainConfigs(l1ChainID, l2ChainID, contractAddresses) {
},
rpcUrls: {
default: {
http: ['http://localhost:8545'],
http: [process.env.ETH_RPC_URL_L1],
},
},
contracts: {
Expand Down
2 changes: 2 additions & 0 deletions op-e2e/celo/test_npm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
#shellcheck disable=SC1091
set -eo pipefail

source shared.sh
npm test

0 comments on commit ae24418

Please sign in to comment.