Skip to content

Add Test Suite for eth rpc methods - #14

Open
moglu2017 wants to merge 16 commits into
mainfrom
moglu/eth_rpc
Open

Add Test Suite for eth rpc methods#14
moglu2017 wants to merge 16 commits into
mainfrom
moglu/eth_rpc

Conversation

@moglu2017

Copy link
Copy Markdown
Contributor

Describe your changes

Added a test suite for testing eth RPC methods.
It contains 4 test groups:

eth_rpc_schema — validates the JSON schema of RPC requests and responses.
ethersjs — tests compatibility with ethers.js.
web3js — tests compatibility with web3.js.
viem — tests compatibility with viem.

moglu2017 added 16 commits June 9, 2026 14:55
…C coverage

  - Wire ethersjs (mocha + ethers v6) into `go test ./...` via a thin
    RunTestMain-driven wrapper; Makefile guards `npm ci`, workflow adds
    setup-node@22 (global WebSocket).
  - Add ws subscription schema tests for newHeads / logs /
    newPendingTransactions (raw gorilla/websocket) plus a syncing-rejected
    pin; ship matching schemas under schemas/.
  - Extend ethersjs suite to 68 tests covering getBlock variants and
    block tags, JsonRpcSigner gaps, multi-shape eth_getLogs, EIP-1898
    block refs, EIP-2930 / eth_blobBaseFee rejections, batched
    JsonRpcProvider, CREATE2 parity (new Create2Factory.sol + multi-file
    compile script), WebSocketProvider end-to-end (block / pending /
    logs / destroy), and method-level Contract estimateGas /
    populateTransaction.
  - main_test.go now defaults THOR_BRANCH=pedro/eth_eq_json_rpc so the
    schema suite runs standalone, mirroring the ethersjs wrapper.
Remove TestWsSubscribeSyncingRejected test case.
Add a viem v2 compatibility suite mirroring ethersjs (provider/wallet/
contract/events/websocket + rpc-extra) and broaden the ethersjs and
eth_rpc_schema suites. All suites follow the same three-category scheme:
implemented methods asserted fully, unimplemented methods skipped, and
divergences (eth_feeHistory rewardPercentiles) skipped until Thor aligns.

- viem: new suite + Go wrapper, wired into Makefile (viem-deps)
- eth_rpc_schema: schemas + tests for chain stubs, uncles, filter family,
  WS syncing subscription; skip table for unimplemented methods
- ethersjs: block/uncle/index methods, filter family, net/web3 metadata,
  ENS skips, WS once/syncing
- Prevents concurrent eth_rpc suites from reusing the same funded
  account's nonce, which caused pending transactions to never be
  mined and suites to fail with receipt/block timeouts
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