Skip to content

refactor: simplify state diff tests with rstest - #7716

Merged
LesnyRumcajs merged 1 commit into
mainfrom
rstest-state-diff-cases
Oct 6, 2026
Merged

LesnyRumcajs merged 1 commit into
mainfrom
rstest-state-diff-cases

Conversation

@LesnyRumcajs

@LesnyRumcajs LesnyRumcajs commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary of changes

Changes introduced in this pull request:

  • simplify state diff tests with rstest - more to come!

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • This pull request is based on an issue that a maintainer has accepted (see Before Opening a Pull Request).
  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Tests
    • Expanded coverage for state-difference reporting, including balance and nonce changes, bytecode updates, and actor creation or deletion.
    • Added checks for cases where state remains unchanged and where balance and nonce change together.

@LesnyRumcajs
LesnyRumcajs requested a review from a team as a code owner October 6, 2026 15:39
@LesnyRumcajs
LesnyRumcajs requested review from EclesioMeloJunior and akaladarshi and removed request for a team October 6, 2026 15:39
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: eb0225af-d1f2-42b3-a7b1-9915d05489b7
📥 Commits

Reviewing files that changed from the base of the PR and between d0cf84a and 688355d.

📒 Files selected for processing (1)
  • src/rpc/methods/eth/trace/state_diff.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

State-diff tests now use rstest cases for changed-actor deltas and EVM actor scenarios. The tests cover balance and nonce changes, bytecode changes, unchanged state, actor creation, and actor deletion.

Changes

State diff tests

Layer / File(s) Summary
Parameterize actor state-diff tests
src/rpc/methods/eth/trace/state_diff.rs
Changed-actor tests use cases for balance and nonce deltas. EVM actor tests use cases for unchanged state, balance and nonce changes, bytecode changes, creation, and deletion. Fixtures pass bytecode slices directly.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 68835

The test change retains the previously exercised scenarios, with no actionable merge-blocking risk established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: simplifying state diff tests with rstest.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.1)

Clippy execution failed


Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.76%. Comparing base (2d74365) to head (688355d).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
Files with missing lines Coverage Δ
src/rpc/methods/eth/trace/state_diff.rs 84.59% <100.00%> (-3.62%) ⬇️

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d74365...688355d. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LesnyRumcajs
LesnyRumcajs added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit e409411 Oct 6, 2026
35 checks passed
@LesnyRumcajs
LesnyRumcajs deleted the rstest-state-diff-cases branch October 6, 2026 17:47
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.

2 participants