-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix: Added the web3_clientVersion to the websocket server. #2486
Conversation
Signed-off-by: ebadiere <[email protected]>
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.
It's necessary to add WEB3_CLIENTVERSION: 'web3_clientVersion'
in WS_CONSTANTS.METHODS or else the server will return Method web3_clientVersion not found
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.
Can we add an acceptance test aswell?
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
Signed-off-by: ebadiere <[email protected]>
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.
LGTM
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.
LG.
Execution pathway logic should be improved
Signed-off-by: ebadiere <[email protected]>
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.
one question, otherwise looks good
case 'eth': | ||
txRes = await relay.eth()[methodName](...resolvedParams, requestIdPrefix); | ||
break; | ||
case 'get': |
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.
are we supporting any get
or debug
pathways yet?
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.
@Nana-EC asked that the pathways be specific, in the above comments.
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.
a simple improvement
const txRes = await relay.eth()[method.split('_')[1]](...resolvedParams, requestIdPrefix); | ||
const [service, methodName] = method.split('_'); | ||
let txRes; | ||
switch (service) { |
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.
I think there's a possible replacement for this whole switch statement is this below:
switch (service) { | |
const txRes = await relay[service]()[methodName](...resolvedParams, requestIdPrefix); |
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.
And we don't have to worry about throwing new Error(
Unsupported JSON RPC service type: ${service});
as there's already an unsupported method check (verifySupportedMethod()) to check validity of the methods before it gets to this step.
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.
Signed-off-by: ebadiere <[email protected]>
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.
LGTM
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.
LG
An extra comment would be good
Signed-off-by: ebadiere <[email protected]>
Quality Gate passedIssues Measures |
* fix: Added the web3_clientVersion to the websocket server. Signed-off-by: ebadiere <[email protected]> * fix: Updated web3_clientVersion and test. Signed-off-by: ebadiere <[email protected]> * fix: Removed only. Signed-off-by: ebadiere <[email protected]> * fix: applied feedback Signed-off-by: ebadiere <[email protected]> * fix: Added addition service method handling paths. Signed-off-by: ebadiere <[email protected]> * fix: Reduced the switch statement to one line. Signed-off-by: ebadiere <[email protected]> * fix: Added comment describing JSON RPC validation method. Signed-off-by: ebadiere <[email protected]> --------- Signed-off-by: ebadiere <[email protected]>
* fix: Added the web3_clientVersion to the websocket server. Signed-off-by: ebadiere <[email protected]> * fix: Updated web3_clientVersion and test. Signed-off-by: ebadiere <[email protected]> * fix: Removed only. Signed-off-by: ebadiere <[email protected]> * fix: applied feedback Signed-off-by: ebadiere <[email protected]> * fix: Added addition service method handling paths. Signed-off-by: ebadiere <[email protected]> * fix: Reduced the switch statement to one line. Signed-off-by: ebadiere <[email protected]> * fix: Added comment describing JSON RPC validation method. Signed-off-by: ebadiere <[email protected]> --------- Signed-off-by: ebadiere <[email protected]> Signed-off-by: Alfredo Gutierrez <[email protected]>
fix: Added the web3_clientVersion to the websocket server. (#2486) * fix: Added the web3_clientVersion to the websocket server. * fix: Updated web3_clientVersion and test. * fix: Removed only. * fix: applied feedback * fix: Added addition service method handling paths. * fix: Reduced the switch statement to one line. * fix: Added comment describing JSON RPC validation method. --------- Signed-off-by: ebadiere <[email protected]> Signed-off-by: Alfredo Gutierrez <[email protected]> Co-authored-by: Eric Badiere <[email protected]>
Added the
web3_clientVersion
to the websocket server.Fixes #2462