Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of Celo e2e tests + convert to Typescript #294

Open
wants to merge 12 commits into
base: celo10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions op-e2e/celo/babel.config.cjs

This file was deleted.

7 changes: 7 additions & 0 deletions op-e2e/celo/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
testEnvironment: 'node',
transform: {
'^.+.tsx?$': ['ts-jest', {}],
},
maxWorkers: 1,
}
5 changes: 0 additions & 5 deletions op-e2e/celo/jest.config.json

This file was deleted.

7,414 changes: 3,106 additions & 4,308 deletions op-e2e/celo/package-lock.json

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions op-e2e/celo/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{
"name": "testsuite",
"name": "celo2test",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/test.js",
"author": "Celo Labs Inc.",
"license": "ISC",
"scripts": {
"test": "jest tests --detectOpenHandles",
"test": "jest",
"format": "npx prettier . --write"
},
"author": "Celo Labs Inc.",
"license": "ISC",
"dependencies": {
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.10",
"chai": "^5.1.2",
"mocha": "^11.0.1",
"prettier": "^3.4.2",
"reverse-mirage": "^1.1.0",
"viem": "^2.13.1"
"ts-node": "^10.9.2",
"viem": "^2.22.8"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"babel-jest": "^29.7.0",
"@types/jest": "^29.5.14",
"jest": "^29.7.0",
"prettier": "3.3.3"
"ts-jest": "^29.2.5",
"typescript": "^5.7.3"
}
}
3 changes: 1 addition & 2 deletions op-e2e/celo/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ spawn_devnet=${SPAWN_DEVNET:-true}
if [[ $spawn_devnet != false ]]; then
## Start geth
cd "$SCRIPT_DIR/../.." || exit 1
trap 'cd "$SCRIPT_DIR/../.." && make devnet-down' EXIT # kill bg job at exit
DEVNET_CELO=true make devnet-up
make devnet-clean && DEVNET_CELO=true SAFE_AS_OWNER=true make devnet-up
fi

cd "$SCRIPT_DIR" || exit 1
Expand Down
2 changes: 1 addition & 1 deletion op-e2e/celo/shared.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#shellcheck disable=SC2034 # unused vars make sense in a shared file

export ETH_RPC_URL=http://localhost:9545
export ETH_RPC_URL_L2=http://localhost:9545
export ETH_RPC_URL_L1=http://localhost:8545

export ACC_PRIVKEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,32 @@ export const OptimismPortalABI = [
outputs: [],
stateMutability: 'nonpayable',
},
{
type: 'function',
name: 'msgSender3',
inputs: [],
outputs: [
{
name: '',
type: 'address',
internalType: 'address',
},
],
stateMutability: 'nonpayable',
},
{
type: 'function',
name: 'msgSenderrr',
inputs: [],
outputs: [
{
name: '',
type: 'address',
internalType: 'address',
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'provenWithdrawals',
Expand Down
71 changes: 0 additions & 71 deletions op-e2e/celo/src/chain.js

This file was deleted.

97 changes: 97 additions & 0 deletions op-e2e/celo/src/chain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { chainConfig } from 'viem/op-stack'
import { Address, defineChain } from 'viem'
import { AddressesType } from './setup'

export type ChainConfigL1L2 = ReturnType<typeof makeChainConfigs>

export function makeChainConfigs(
l1ChainID: number,
l2ChainID: number,
contractAddresses: AddressesType
) {
return {
l2: defineChain({
formatters: {
...chainConfig.formatters,
},
serializers: {
...chainConfig.serializers,
},
id: l2ChainID,
name: 'Celo',
nativeCurrency: {
decimals: 18,
name: 'Celo - native currency',
symbol: 'CELO',
},
rpcUrls: {
default: {
http: [process.env.ETH_RPC_URL_L2 ?? 'http://localhost:9545'],
},
},
contracts: {
...chainConfig.contracts,
l2OutputOracle: {
[l1ChainID]: {
address: contractAddresses.L2OutputOracleProxy as Address,
},
},
disputeGameFactory: {
[l1ChainID]: {
address: contractAddresses.DisputeGameFactoryProxy as Address,
},
},
portal: {
[l1ChainID]: {
address: contractAddresses.OptimismPortalProxy as Address,
},
},
l1StandardBridge: {
[l1ChainID]: {
address: contractAddresses.L1StandardBridgeProxy as Address,
},
},
},
}),
l1: defineChain({
id: l1ChainID,
testnet: true,
name: 'Ethereum L1',
nativeCurrency: {
decimals: 18,
name: 'Ether',
symbol: 'ETH',
},
rpcUrls: {
default: {
http: [process.env.ETH_RPC_URL_L1 ?? 'http://localhost:8545'],
},
},
contracts: {
multicall3: {
address: contractAddresses.Multicall3 as Address,
},
l2OutputOracle: {
[l1ChainID]: {
address: contractAddresses.L2OutputOracleProxy as Address,
},
},
disputeGameFactory: {
[l1ChainID]: {
address: contractAddresses.DisputeGameFactoryProxy as Address,
},
},
portal: {
[l1ChainID]: {
address: contractAddresses.OptimismPortalProxy as Address,
},
},
l1StandardBridge: {
[l1ChainID]: {
address: contractAddresses.L1StandardBridgeProxy as Address,
},
},
},
}),
}
}
98 changes: 0 additions & 98 deletions op-e2e/celo/src/config.js

This file was deleted.

Loading
Loading