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

Refactor: Reuse rpcv6 juno_version handler for v7 and v8 #2471

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hudem1
Copy link
Contributor

@hudem1 hudem1 commented Feb 13, 2025

rpc pkg cleanup according to #2437

Reuse v6 handler for both v7 and v8

@hudem1 hudem1 mentioned this pull request Feb 13, 2025
23 tasks
@hudem1 hudem1 added RPC JSON RPC API Refactor labels Feb 13, 2025
Copy link
Contributor

@rianhughes rianhughes left a comment

Choose a reason for hiding this comment

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

Importing the "errors" pkg should fix the tests and lint errors. Approving now to unblock this PR

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.63%. Comparing base (94071e4) to head (513947d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2471      +/-   ##
==========================================
- Coverage   73.65%   73.63%   -0.03%     
==========================================
  Files         137      137              
  Lines       16659    16652       -7     
==========================================
- Hits        12271    12261      -10     
- Misses       3526     3528       +2     
- Partials      862      863       +1     

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

rpc/handlers.go Outdated
@@ -197,7 +197,7 @@ func (h *Handler) MethodsV0_8() ([]jsonrpc.Method, string) { //nolint: funlen
},
{
Name: "juno_version",
Handler: h.rpcv8Handler.Version,
Handler: h.rpcv6Handler.Version,
Copy link
Contributor

Choose a reason for hiding this comment

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

The Version method shouldn't be part of any rpc. It should be a property of the "Master Handler" defined in rpc/handlers.go and it should have that method. No need to have the info replicated in three different structs.

Note that this is an exception since "juno_version" is not part of any specs. Also, every rpc should still expose the "juno_version" rpc, but they should all point to the one defined in the "Master Handler".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@hudem1 hudem1 requested a review from rodrigo-pino February 19, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor RPC JSON RPC API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants