Skip to content

Add pytest configuration and initial test cases for EIP-7702 transactions #3

Add pytest configuration and initial test cases for EIP-7702 transactions

Add pytest configuration and initial test cases for EIP-7702 transactions #3

Workflow file for this run

name: pytest
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
concurrency:
group: pytest-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13.11"
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
enable-cache: true
- name: Install dependencies
run: make install
- name: Start Hardhat node
run: |
# Ensure our config is used (chainId=2026 / hardfork=osaka)
nohup npx hardhat --config ./hardhat.config.js node --hostname 127.0.0.1 --port 8545 > hardhat-node.log 2>&1 &
# Quick diagnostics (helps when the node exits immediately)
echo "== hardhat-node.log (first 200 lines) =="
(sleep 1; sed -n '1,200p' hardhat-node.log) || true
echo "== process listing =="
ps aux | grep -E "hardhat( |$)" | grep -v grep || true
echo "== port 8545 listeners =="
(ss -ltnp | grep ':8545' || true)
- name: Wait for RPC
run: |
python - <<'PY'
import json
import time
import urllib.request
url = "http://127.0.0.1:8545"
payload = json.dumps({"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}).encode()
last = None
for i in range(60):
try:
req = urllib.request.Request(url, data=payload, headers={"Content-Type":"application/json"})
with urllib.request.urlopen(req, timeout=2) as resp:
raw = resp.read().decode()
last = raw
data = json.loads(raw)
if data.get("result") == "0x7ea": # 2026
print("RPC ready:", data["result"])
break
except Exception as e:
last = f"{type(e).__name__}: {e}"
time.sleep(1)
else:
print("RPC not ready. Last response/error:", last)
raise SystemExit("RPC not ready")
PY
- name: Dump Hardhat node log (if RPC wait failed)
if: failure()
run: |
echo "== hardhat-node.log (tail 300) =="
tail -n 300 hardhat-node.log || true
- name: Run tests
run: make test
- name: Upload Hardhat node log (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: hardhat-node-log
path: hardhat-node.log
if-no-files-found: ignore