Skip to content

Commit 7997629

Browse files
authored
feat: tempo (#140)
* wip * fmt * chore: jsdoc * chore: up * up * wip * wip * wip * wip * wip * wip
1 parent 29a2f43 commit 7997629

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+14501
-582
lines changed

.changeset/tame-eagles-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ox": minor
3+
---
4+
5+
Added `ox/tempo` entrypoint.

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
VITE_ANVIL_FORK_URL= # anvil fork url.
2+
VITE_TEMPO_ENV=localnet # node environment. values: localnet|devnet|testnet
3+
VITE_TEMPO_LOG=false # whether to enable logs, if VITE_TEMPO_ENV=localnet. values: true|debug|error|trace|warn|info
4+
VITE_TEMPO_TAG= # docker image tag, if VITE_TEMPO_ENV=localnet.
5+
VITE_TEMPO_HTTP_LOG=false # whether to enable logs on HTTP RPC requests. values: true|false

.github/CONTRIBUTING.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ This guide is intended to help you get started with contributing. By following t
1616

1717
1. [Cloning the repository](#cloning-the-repository)
1818
2. [Installing Node.js and pnpm](#installing-nodejs-and-pnpm)
19-
3. [Installing Foundry](#installing-foundry)
20-
4. [Installing dependencies](#installing-dependencies)
21-
5. [Running the test suite](#running-the-test-suite)
22-
6. [Writing documentation](#writing-documentation)
23-
7. [Submitting a pull request](#submitting-a-pull-request)
24-
8. [Versioning](#versioning)
19+
3. [Installing Foundry & Tempo](#installing-foundry--tempo)
20+
5. [Installing dependencies](#installing-dependencies)
21+
6. [Running the test suite](#running-the-test-suite)
22+
7. [Writing documentation](#writing-documentation)
23+
8. [Submitting a pull request](#submitting-a-pull-request)
24+
9. [Versioning](#versioning)
2525

2626
---
2727

@@ -67,14 +67,17 @@ If the versions are not correct or you don't have Node.js or pnpm installed, dow
6767

6868
---
6969

70-
### Installing Foundry
70+
### Installing Foundry & Tempo
7171

72-
Ox 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.
72+
Ox uses [Foundry](https://book.getfoundry.sh/) & [Tempo](https://github.com/tempoxyz/tempo) for testing.
7373

74-
Install Foundry using the following command:
74+
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.
75+
76+
Install Foundry & Tempo using the following command:
7577

7678
```bash
7779
curl -L https://foundry.paradigm.xyz | bash
80+
curl -L https://tempo.xyz/install | bash
7881
```
7982

8083
<div align="right">

.github/workflows/verify.yml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
- name: Check TSDoc
2828
run: pnpm check:tsdoc
2929

30-
test:
31-
name: Test Runtime
30+
test-core:
31+
name: Test Runtime (core)
3232
runs-on: ubuntu-latest
33+
3334
steps:
3435
- name: Clone repository
3536
uses: actions/checkout@v4
@@ -40,10 +41,55 @@ jobs:
4041
uses: ./.github/actions/install-dependencies
4142

4243
- name: Run tests
43-
run: pnpm test:ci
44+
run: pnpm test --project core,ercs --bail=1 --coverage
4445
env:
4546
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }}
4647

48+
test-tempo:
49+
name: 'Test Runtime (tempo, env: localnet, tag: ${{ matrix.tag }})'
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
tag:
54+
- latest
55+
- https://rpc.testnet.tempo.xyz
56+
57+
steps:
58+
- name: Clone repository
59+
uses: actions/checkout@v4
60+
with:
61+
submodules: 'recursive'
62+
63+
- name: Install dependencies
64+
uses: ./.github/actions/install-dependencies
65+
66+
- name: Run tests
67+
run: pnpm test --project tempo --bail=1 --coverage
68+
env:
69+
VITE_TEMPO_TAG: ${{ matrix.tag }}
70+
71+
test-tempo-e2e:
72+
name: 'Test Runtime (tempo, env: ${{ matrix.tempo-env }}, e2e)'
73+
runs-on: ubuntu-latest
74+
strategy:
75+
matrix:
76+
tempo-env:
77+
- testnet
78+
79+
steps:
80+
- name: Clone repository
81+
uses: actions/checkout@v4
82+
with:
83+
submodules: 'recursive'
84+
85+
- name: Install dependencies
86+
uses: ./.github/actions/install-dependencies
87+
88+
- name: Run tests
89+
run: pnpm test --project tempo e2e --bail=1
90+
env:
91+
VITE_TEMPO_ENV: ${{ matrix.tempo-env }}
92+
4793
vectors:
4894
name: Vectors
4995
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lookup.json
1919
config-generated.ts
2020
site/pages/api
2121
site/pages/ercs
22+
site/pages/tempo
2223
site/pages/glossary
2324
tsdoc-metadata.json
2425
*.timestamp*

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"prepare": "pnpm simple-git-hooks",
3333
"size": "size-limit",
3434
"test": "vitest -c ./test/vitest.config.ts",
35-
"test:ci": "CI=true vitest -c ./test/vitest.config.ts --coverage --retry=3 --bail=1",
3635
"test:cov": "vitest -c ./test/vitest.config.ts --coverage",
3736
"test:types": "TYPES=true vitest -c ./test/vitest.config.ts",
3837
"vectors": "bun test vectors/**/*.test.ts",
@@ -55,7 +54,7 @@
5554
"@types/bun": "^1.1.6",
5655
"@types/fs-extra": "^11.0.4",
5756
"@types/node": "^22.5.4",
58-
"@vitest/coverage-v8": "1.0.4",
57+
"@vitest/coverage-v8": "^4.0.15",
5958
"bun": "^1.1.24",
6059
"eslint": "^9.9.0",
6160
"eslint-plugin-jsdoc": "^50.0.1",
@@ -64,18 +63,20 @@
6463
"fs-extra": "^11.2.0",
6564
"knip": "^5.27.2",
6665
"micro-eth-signer": "^0.15.0",
67-
"prool": "^0.0.23",
66+
"prool": "~0.2.1",
6867
"rimraf": "^5.0.10",
6968
"sherif": "^0.11.0",
7069
"simple-git-hooks": "^2.11.1",
7170
"size-limit": "^11.1.4",
71+
"tempo.ts": "^0.10.5",
72+
"testcontainers": "^11.10.0",
7273
"ts-morph": "^24.0.0",
7374
"tsx": "^4.17.0",
7475
"typescript": "^5.5.4",
7576
"typescript-eslint": "^8.1.0",
76-
"viem": "^2.21.9",
77+
"viem": "^2.41.2",
7778
"vite-tsconfig-paths": "^5.0.1",
78-
"vitest": "1.0.4",
79+
"vitest": "^4.0.15",
7980
"vocs": "^1.0.13",
8081
"web3": "^4.12.1"
8182
},

0 commit comments

Comments
 (0)