Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
87a0feb
test: add an in-process Tevm test lane
roninjin10 Jul 28, 2026
88cee2f
test: replace Anvil harness with Tevm
roninjin10 Jul 29, 2026
5dfad74
test(account-abstraction): point tests at the Tevm harness
roninjin10 Jul 29, 2026
a4b47e6
test(account-abstraction): assert addresses and hashes with Tevm matc…
roninjin10 Jul 29, 2026
391269d
test(core-utils): migrate utils/errors/accounts suites onto the Tevm …
roninjin10 Jul 29, 2026
5b87bd6
test(rpc/http): assert Tevm client version and stub JSON-RPC error re…
roninjin10 Jul 29, 2026
27a33db
test(account-abstraction): back the AA harness with the Tevm node
roninjin10 Jul 29, 2026
c7af92c
test(public): migrate basic chain actions to tevm
roninjin10 Jul 29, 2026
43a9e33
test(core-utils): work around missing Tevm signing RPCs and error shapes
roninjin10 Jul 29, 2026
88270fe
test(ens): migrate getEnsResolver to tevm harness
roninjin10 Jul 29, 2026
0968597
test(experimental): migrate wallet capability tests to tevm
roninjin10 Jul 29, 2026
41be585
test(experimental): use tevm harness and matchers
roninjin10 Jul 29, 2026
8d6abf7
test(celo): remove anvil-only client mode
roninjin10 Jul 29, 2026
5198daa
test(clients): migrate client creation suites off anvil
roninjin10 Jul 29, 2026
9200e74
test(nonceManager,ccip): mine explicitly and harden revert-data extra…
roninjin10 Jul 29, 2026
aa91033
test(public): cover access lists with tevm
roninjin10 Jul 29, 2026
b633fac
test(ens): migrate getEnsAddress to tevm harness
roninjin10 Jul 29, 2026
8a1b95c
test(ccip): recover revert data from Tevm's rendered error message
roninjin10 Jul 29, 2026
c516c9c
test(ens): migrate getEnsName to tevm harness
roninjin10 Jul 29, 2026
2d24041
test(op-stack): migrate mainnet-safe tests to tevm
roninjin10 Jul 29, 2026
917f027
test(ens): migrate getEnsText to tevm harness
roninjin10 Jul 29, 2026
04ae220
test(clients): migrate wallet decorator suite to tevm
roninjin10 Jul 29, 2026
290a0fd
test(ens): migrate getEnsAvatar to tevm harness
roninjin10 Jul 29, 2026
855430d
test(public): migrate supported public actions to tevm
roninjin10 Jul 29, 2026
c0223ac
test(erc7739): deploy fixtures through tevm harness
roninjin10 Jul 29, 2026
967e424
test(op-stack): migrate public L1 tests to tevm
roninjin10 Jul 29, 2026
7e0fdfe
test(actions): migrate test actions to tevm
roninjin10 Jul 29, 2026
288217e
test(wallet): migrate wallet actions to tevm
roninjin10 Jul 29, 2026
84e93c6
test(actions): migrate getContract to tevm harness
roninjin10 Jul 29, 2026
bb9ca04
test(ens): migrate ENS benches to tevm harness
roninjin10 Jul 29, 2026
cd15923
style: organize imports in getEnsAvatar test
roninjin10 Jul 29, 2026
403b612
style: organize imports in getEnsAddress test
roninjin10 Jul 29, 2026
f3dd283
test(clients): migrate public decorator suite to tevm
roninjin10 Jul 29, 2026
4d42501
test(clients): migrate test decorator suite to tevm
roninjin10 Jul 29, 2026
6f8dad6
test(clients): inline createHttpServer in fallback suite
roninjin10 Jul 29, 2026
3eddce5
style(clients): organize imports in decorator suites
roninjin10 Jul 29, 2026
3ac7426
fix(clients): type-clean migrated suites
roninjin10 Jul 29, 2026
9d1e06b
chore(preflight): preserve pre-existing working-copy changes before o…
roninjin10 Jul 29, 2026
f8618fe
test: finish Tevm migration verification
roninjin10 Jul 29, 2026
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
13 changes: 5 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
VITE_ANVIL_FORK_URL=
VITE_ANVIL_FORK_URL_SEPOLIA=
VITE_ANVIL_FORK_URL_OPTIMISM=
VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA=
VITE_ANVIL_FORK_URL_GOERLI=
VITE_ANVIL_FORK_URL_ZKSYNC=
VITE_TEVM_FORK_URL=
VITE_TEVM_FORK_URL_OPTIMISM=
VITE_TEVM_FORK_URL_SEPOLIA=
VITE_TEVM_FORK_URL_ZKSYNC=
VITE_BATCH_JSON_RPC=false
VITE_BATCH_MULTICALL=true
VITE_NETWORK_TRANSPORT_MODE=http

VITE_TEMPO_ENV=localnet # node environment. values: localnet|devnet|testnet
VITE_TEMPO_LOG=false # whether to enable logs, if VITE_TEMPO_ENV=localnet. values: true|debug|error|trace|warn|info
VITE_TEMPO_TAG=latest # docker image tag, if VITE_TEMPO_ENV=localnet.
VITE_TEMPO_HTTP_LOG=false # whether to enable logs on HTTP RPC requests. values: true|false
VITE_TEMPO_HTTP_LOG=false # whether to enable logs on HTTP RPC requests. values: true|false
50 changes: 21 additions & 29 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ This guide is intended to help you get started with contributing. By following t

1. [Cloning the repository](#cloning-the-repository)
2. [Installing Node.js and pnpm](#installing-nodejs-and-pnpm)
3. [Installing Foundry](#installing-foundry)
4. [Installing dependencies](#installing-dependencies)
5. [Running the test suite](#running-the-test-suite)
6. [Writing documentation](#writing-documentation)
7. [Submitting a pull request](#submitting-a-pull-request)
8. [Versioning](#versioning)
3. [Installing dependencies](#installing-dependencies)
4. [Running the test suite](#running-the-test-suite)
5. [Writing documentation](#writing-documentation)
6. [Submitting a pull request](#submitting-a-pull-request)
7. [Versioning](#versioning)

---

Expand Down Expand Up @@ -70,22 +69,6 @@ If the versions are not correct or you don't have Node.js or pnpm installed, dow

---

### Installing Foundry

Viem uses [Foundry](https://book.getfoundry.sh/) for testing. We run a local [Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) instance against a forked Ethereum node, where we can also use tools like [Forge](https://book.getfoundry.sh/forge/) to deploy test contracts to it.

Install Foundry using the following command:

```bash
curl -L https://foundry.paradigm.xyz | bash
```

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>

---

### Installing dependencies

Once in the project's root directory, run the following command to install the project's dependencies:
Expand All @@ -107,23 +90,32 @@ After the install completes, pnpm links packages across the project for developm
First, add the following to your environment (recommended to use [`direnv`](https://github.com/direnv/direnv)):

```bash
VITE_ANVIL_FORK_URL=
VITE_ANVIL_FORK_URL_OPTIMISM=
VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA=
VITE_ANVIL_FORK_URL_SEPOLIA=
VITE_ANVIL_FORK_URL_ZKSYNC=
VITE_TEVM_FORK_URL=
VITE_BATCH_MULTICALL=false
VITE_NETWORK_TRANSPORT_MODE=http
```

`VITE_ANVIL_FORK_URL` can be for any RPC service provider (e.g. Alchemy or Infura) for the mainnet. Now you are ready to run the tests!
`VITE_TEVM_FORK_URL` can be any archive-capable mainnet RPC service (for
example, Alchemy or Infura). Tevm forks the pinned test block into each Vitest
worker and runs the EVM in-process. Tests that fork other networks use the
optional `VITE_TEVM_FORK_URL_OPTIMISM`, `VITE_TEVM_FORK_URL_SEPOLIA`, and
`VITE_TEVM_FORK_URL_ZKSYNC` variables. Their endpoints must also retain the
historical state at the fixture's pinned block.

- `pnpm test` — runs tests in watch mode

Sometimes there may be some tests which fail unexpectedly – you can press `f` to rerun them and they should pass.

When adding new features or fixing bugs, it's important to add test cases to cover the new/updated behavior.

All core tests use the in-process Tevm harness. See
[`test/README.md`](../test/README.md) for the fixture API, matcher catalog, and
the WebSocket/IPC blocker that is intentionally excluded from CI until Tevm
provides those servers.

Foundry is not needed for the default build or test suite. Install it only to
run the explicitly opt-in WebSocket/IPC blocker project documented in the test
README.

<div align="right">
<a href="#basic-guide">&uarr; back to top</a></b>
</div>
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ description: "Prepare repository and all dependencies"
runs:
using: "composite"
steps:
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-a3d78b09bd0b7f5170368e6c0db794f2431dadae

- name: Set up pnpm
uses: wevm/actions/.github/actions/pnpm@main
with:
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,14 @@ jobs:

- run: pnpm i -d -w typescript@${{ matrix.version }}

- name: Build contracts
shell: bash
run: pnpm contracts:build

- name: Check types
run: pnpm check:types

- name: Bench types
run: pnpm bench:types

test:
name: 'Test Local (transport: ${{ matrix.transport-mode }}, multicall: ${{ matrix.multicall }}, ${{ matrix.shard }}/${{ matrix.total-shards }})'
name: 'Test Local (Tevm, multicall: ${{ matrix.multicall }}, ${{ matrix.shard }}/${{ matrix.total-shards }})'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
Expand All @@ -100,7 +96,6 @@ jobs:
max-parallel: 3
matrix:
multicall: ['true', 'false']
transport-mode: ['http', 'webSocket']
shard: [1, 2, 3]
total-shards: [3]
steps:
Expand All @@ -112,10 +107,6 @@ jobs:
- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Build contracts
shell: bash
run: pnpm contracts:build

- name: Test Local
uses: nick-fields/retry@v3
with:
Expand All @@ -124,13 +115,8 @@ jobs:
command: pnpm test --bail=1 --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
env:
CI: true
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }}
VITE_ANVIL_FORK_URL_OPTIMISM: ${{ secrets.VITE_ANVIL_FORK_URL_OPTIMISM }}
VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA: ${{ secrets.VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA }}
VITE_ANVIL_FORK_URL_SEPOLIA: ${{ secrets.VITE_ANVIL_FORK_URL_SEPOLIA }}
VITE_ANVIL_FORK_URL_ZKSYNC: ${{ secrets.VITE_ANVIL_FORK_URL_ZKSYNC }}
VITE_TEVM_FORK_URL: ${{ secrets.VITE_TEVM_FORK_URL }}
VITE_BATCH_MULTICALL: ${{ matrix.multicall }}
VITE_NETWORK_TRANSPORT_MODE: ${{ matrix.transport-mode }}
VITE_SHARD_ID: ${{ matrix.shard }}
VITE_TEMPO_ENV: localnet
VITE_TEMPO_TAG: https://rpc.testnet.tempo.xyz
Expand Down Expand Up @@ -200,9 +186,6 @@ jobs:
with:
submodules: 'recursive'

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Set up pnpm
uses: wevm/actions/.github/actions/pnpm@main

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ src/node/trustedSetups_esm.ts
**/trusted-setups/**/*.txt
.idea
.pnpm-store
.smithers/
smithers.db*

# local env files
.env
Expand All @@ -26,7 +28,6 @@ src/node/trustedSetups_esm.ts
.envrc

# tests
generated.ts
vectors/**/*.json

# docs
Expand Down
Loading
Loading