Skip to content

Comments

Cover evm-rpc with tests#434

Open
kalabukdima wants to merge 6 commits intoopen-betafrom
rpc-tests
Open

Cover evm-rpc with tests#434
kalabukdima wants to merge 6 commits intoopen-betafrom
rpc-tests

Conversation

@kalabukdima
Copy link

It makes the existing code more robust to changes and allows fearless contribution with the help of AI

@kalabukdima kalabukdima requested a review from tmcgroul February 11, 2026 09:23
@belopash
Copy link
Contributor

belopash commented Feb 11, 2026

Usually it is better to use some testing frameworks (e.g. jest, mocha, vitest) because they support more features. They all have the similar interface, so it won't be a problem to migrate

I mean, it's the matter of taste. Native tests are fine if everyone else is ok with it

@kalabukdima kalabukdima requested a review from belopash February 11, 2026 10:13
@kalabukdima
Copy link
Author

Usually it is better to use some testing frameworks (e.g. jest, mocha, vitest) because they support more features. They all have the similar interface, so it won't be a problem to migrate

I mean, it's the matter of taste. Native tests are fine if everyone else is ok with it

I didn't want to introduce a new framework and just followed the pattern of other tests in the project

@belopash
Copy link
Contributor

I didn't want to introduce a new framework and just followed the pattern of other tests in the project

don't they use mocha?

@tmcgroul
Copy link
Contributor

would it make sense to unite verification and chain-utils tests? don't get the idea about keeping them separete - both import and rely on ChainUtils class anyway

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive test coverage for the evm-rpc package, making the existing code more robust to changes and enabling confident contributions with AI assistance. The tests use Node.js native test runner and fixture-based testing to verify block verification, chain-specific utilities, and RPC client integration across multiple EVM chains.

Changes:

  • Adds test infrastructure including fixture loader, mock RPC client, and fixture capture utility
  • Implements comprehensive test suites for verification functions, chain utilities, and RPC integration
  • Adds test fixtures for Ethereum, Polygon, Arbitrum, and Hyperliquid chains
  • Updates TypeScript configuration with noUnusedLocals compiler option
  • Adds test scripts and documentation

Reviewed changes

Copilot reviewed 14 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
evm/evm-rpc/tsconfig.json Enables noUnusedLocals compiler option for stricter code quality
evm/evm-rpc/tsconfig.test.json New TypeScript configuration for test files with noEmit option
evm/evm-rpc/package.json Adds test scripts and tsx dependency for TypeScript test execution
evm/evm-rpc/test/README.md Documents test execution and fixture capture procedures
evm/evm-rpc/test/helpers/fixture-loader.ts Utility for loading test fixtures from JSON files
evm/evm-rpc/test/helpers/mock-rpc-client.ts Mock RPC client implementation for testing
evm/evm-rpc/test/capture-fixtures.ts CLI tool for capturing test fixtures from live RPC endpoints
evm/evm-rpc/test/verification.test.ts Tests for block hash, transaction root, receipts root, and logs bloom verification
evm/evm-rpc/test/chain-utils.test.ts Tests for chain-specific logic (Polygon state-sync, Arbitrum tx types, Hyperliquid system txs)
evm/evm-rpc/test/rpc.test.ts Integration tests for RPC class including block retrieval, receipts, and verification
evm/evm-rpc/test/fixtures/*/block.json Test fixture data for various chains and blocks
evm/evm-rpc/test/fixtures/*/receipts.json Test receipt data for various chains and blocks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mo4islona
Copy link
Contributor

I didn't want to introduce a new framework and just followed the pattern of other tests in the project

don't they use mocha?

We have Mocha alongside Vitest, and some packages use assert directly

kalabukdima and others added 4 commits February 18, 2026 12:32
- 45 tests covering verification functions, chain utilities, and Rpc class
- Fixture-based testing with real RPC data from Ethereum, Polygon, Arbitrum, Hyperliquid
- Node.js native test framework with dynamic fixture discovery

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants