-
Notifications
You must be signed in to change notification settings - Fork 197
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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, |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
rpc pkg cleanup according to #2437
Reuse v6 handler for both v7 and v8