Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 0.6 rpc endpoints #2401

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

AnkushinDaniil
Copy link
Contributor

This pull request partially reverts #2229

Changes to MockVM and ThrottledVM:

  • Modified the Call and Execute methods in MockVM to accept an additional boolean parameter useBlobData. (mocks/mock_vm.go) [1] [2]
  • Updated ThrottledVM to include the useBlobData parameter in its Call and Execute methods. (node/throttled_vm.go) [1] [2]

Changes to RPC Handlers:

  • Introduced new methods BlockWithTxHashesV0_6 and BlockWithTxsV0_6 to handle version 0.6 specific responses. (rpc/block.go) [1] [2]
  • Added a new type FeeEstimateV0_6 and corresponding conversion functions to support fee estimation for version 0.6. (rpc/estimate_fee.go) [1] [2]
  • Implemented EstimateFeeV0_6 and EstimateMessageFeeV0_6 methods to handle fee estimation for version 0.6. (rpc/estimate_fee.go) [1] [2]

Additional Changes:

  • Updated the New function in node/node.go to register methods for both version 0.6 and 0.7, and adjusted the metrics accordingly. (node/node.go) [1] [2]
  • Added tests for the new version 0.6 methods to ensure they work correctly. (rpc/block_test.go, rpc/estimate_fee_test.go) [1] [2] [3]

These changes ensure that the API can handle both version 0.6 and 0.7 requests, providing backward compatibility and supporting new features.

@AnkushinDaniil AnkushinDaniil added RPC JSON RPC API go Pull requests that update Go code labels Jan 25, 2025
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

Attention: Patch coverage is 85.31250% with 47 lines in your changes missing coverage. Please review.

Project coverage is 75.05%. Comparing base (61d810a) to head (e21edc9).

Files with missing lines Patch % Lines
rpc/simulation.go 62.16% 11 Missing and 3 partials ⚠️
rpc/block.go 35.29% 10 Missing and 1 partial ⚠️
rpc/trace.go 73.33% 6 Missing and 2 partials ⚠️
rpc/transaction.go 72.72% 4 Missing and 2 partials ⚠️
node/node.go 77.77% 2 Missing and 2 partials ⚠️
node/throttled_vm.go 33.33% 2 Missing ⚠️
rpc/estimate_fee.go 95.23% 1 Missing ⚠️
rpc/handlers.go 99.39% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2401      +/-   ##
==========================================
+ Coverage   74.48%   75.05%   +0.57%     
==========================================
  Files         113      113              
  Lines       13020    13278     +258     
==========================================
+ Hits         9698     9966     +268     
+ Misses       2587     2562      -25     
- Partials      735      750      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code RPC JSON RPC API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant