Skip to content

fix: restore simulation_results handling in sendJsonRpcRequest - #207

Merged
Sednaoui merged 1 commit into
devfrom
fix/182-simulation-results
Jun 12, 2026
Merged

fix: restore simulation_results handling in sendJsonRpcRequest#207
Sednaoui merged 1 commit into
devfrom
fix/182-simulation-results

Conversation

@Sednaoui

@Sednaoui Sednaoui commented Jun 11, 2026

Copy link
Copy Markdown
Member

Fixes #182

Red/green verified: test/transport/sendJsonRpcRequest.simulation-results.test.js (real local HTTP server) reproduces the TypeError on pre-fix dev (1 failed) and passes with the fix (3 passed).

Summary by CodeRabbit

  • Bug Fixes

    • Restored support for Tenderly-style simulation responses that return simulation_results so these payloads are correctly returned as successful JSON-RPC responses while preserving standard result and error handling.
  • Tests

    • Added end-to-end tests validating handling of simulation_results, standard result, and JSON-RPC error responses.
  • Documentation

    • Changelog updated with the fix.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3da46ad7-4bc1-4c82-9b65-c62ddd5f9728

📥 Commits

Reviewing files that changed from the base of the PR and between 3c37dee and 01a58c8.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/utils.ts
  • test/transport/sendJsonRpcRequest.simulation-results.test.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • test/transport/sendJsonRpcRequest.simulation-results.test.js

📝 Walkthrough

Walkthrough

This PR restores support for Tenderly-style non-standard JSON-RPC responses in sendJsonRpcRequest. A transport refactor previously broke handling of simulation_results field; this change adds a conditional branch to return simulation results as the successful response, prevents TypeErrors, and includes test coverage validating all response patterns.

Changes

sendJsonRpcRequest Tenderly response support

Layer / File(s) Summary
Implementation and changelog
src/utils.ts, CHANGELOG.md
sendJsonRpcRequest adds a check for simulation_results field on the RPC response, returning it as the result when result is not present. Changelog documents the restored behavior for Tenderly-style endpoints.
Test validation
test/transport/sendJsonRpcRequest.simulation-results.test.js
Jest test suite with local HTTP server verifies sendJsonRpcRequest correctly returns simulation_results, handles standard result responses, and rejects errors with expected code and message fields.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A simulation caught the eye,
Results were lost way up high,
We fetch them again,
No more error refrain,
Tenderly calls now respond with a sigh!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description links issue #182 and describes the test verification, but lacks details on what was changed (Summary section), testing approach (Test section), and compatibility implications (Risk/Compatibility section) as specified in the template. Expand description to include: a summary of the code change made to restore simulation_results handling, detailed test approach and coverage, and any risk or compatibility considerations.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: restoring simulation_results handling in sendJsonRpcRequest, which aligns with the primary objective of fixing issue #182.
Linked Issues check ✅ Passed The code changes directly address issue #182 by restoring the simulation_results branch in sendJsonRpcRequest and adding comprehensive test coverage for the fix.
Out of Scope Changes check ✅ Passed All changes (code fix, CHANGELOG update, and test file) are directly scoped to restoring simulation_results handling and verifying the fix, with no extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@Sednaoui
Sednaoui requested a review from sherifahmed990 June 11, 2026 09:18

@sherifahmed990 sherifahmed990 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Sednaoui
Sednaoui force-pushed the fix/182-simulation-results branch from 3c37dee to 01a58c8 Compare June 12, 2026 13:54
@Sednaoui
Sednaoui merged commit cc281cd into dev Jun 12, 2026
2 of 3 checks passed
@Sednaoui
Sednaoui deleted the fix/182-simulation-results branch June 12, 2026 13:56
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.

sendJsonRpcRequest no longer handles simulation_results responses

2 participants