Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add integration tests, README overhaul, and bug fixes#2

Merged
koko1123 merged 2 commits into
mainfrom
koko/add-tests-and-polish
Feb 26, 2026
Merged

Add integration tests, README overhaul, and bug fixes#2
koko1123 merged 2 commits into
mainfrom
koko/add-tests-and-polish

Conversation

@koko1123
Copy link
Copy Markdown
Contributor

Summary

  • Add 15 Anvil-backed integration tests covering chain state, accounts, gas, blocks, wallet transactions, and receipts
  • Overhaul README with "Why eth.zig?" section, ERC-20 examples, feature comparison vs Zabi, examples table
  • Fix use-after-free bug in provider.zig (extractResultString returning slice into freed memory)
  • Fix Zig 0.15 compat issues in provider.zig (optional coercion) and wallet.zig (Thread.sleep)

Test plan

  • zig build test -- all unit tests pass
  • zig fmt --check src/ tests/ -- formatting clean
  • zig build integration-test -Doptimize=ReleaseSafe -- compiles and skips gracefully without Anvil
  • CI green on all matrix entries

Generated with Claude Code

Integration tests (tests/integration_tests.zig):
- 15 Anvil-backed tests covering chain state, account state, gas,
  blocks, wallet transactions, and receipt verification
- Graceful skip when Anvil is not running

README overhaul:
- Add "Why eth.zig?" section with key differentiators
- Add ERC-20 Quick Start example
- Fix HD wallet example to use actual API
- Add examples directory table
- Add feature comparison vs Zabi
- Update module and feature tables with new modules

Bug fixes in provider.zig:
- Fix use-after-free in extractResultString (was returning slice
  into freed JSON parser memory)
- Fix Zig 0.15 optional coercion in parseOptionalHash/parseOptionalHexU64

Bug fix in wallet.zig:
- Fix std.time.sleep -> std.Thread.sleep for Zig 0.15
- bench/bench.zig: 11 benchmarks (keccak, secp256k1, ABI encode/decode,
  RLP, tx serialization, HD wallet, EIP-712, address checksum)
- build.zig: add `zig build bench` step (always ReleaseFast)
- CONTRIBUTING.md: build/test/PR guidelines + architecture diagram
- CHANGELOG.md: full v0.1.0 feature list
- .github/ISSUE_TEMPLATE: bug report + feature request templates
@koko1123 koko1123 merged commit 828503b into main Feb 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant