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

Register converters for socket's JSON RPC #3539

Merged

Conversation

dceleda
Copy link
Contributor

@dceleda dceleda commented Oct 20, 2021

Fixes #3537

Changes:

Register JSON converters for WebSockets and IPC.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

@@ -52,6 +52,8 @@ public async Task Execute(CancellationToken cancellationToken)

JsonRpcService jsonRpcService = new(_api.RpcModuleProvider, _api.LogManager);

_api.EthereumJsonSerializer.RegisterConverters(jsonRpcService.Converters);
Copy link
Contributor Author

@dceleda dceleda Oct 20, 2021

Choose a reason for hiding this comment

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

This change will register JSON RPC converters for the API serializer that is used in multiple places. Is it OK ?
HTTP JSON RPC uses own instance of the serializer. Maybe we should do the same for the sockets or share the same instance with the HTTP module ?

Copy link
Member

Choose a reason for hiding this comment

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

Moved to a single serializer. So for now we have 2 serializers, the one in API is more about internal structures and types. We have second for JSON rpc responses.

@LukaszRozmej LukaszRozmej merged commit 7f030dc into master Oct 21, 2021
@LukaszRozmej LukaszRozmej deleted the bug/3537_DifferentAnswersFromJsonRpcAndWebsockets branch October 21, 2021 07:55
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.

Different answers for eth_syncing from JSON RPC vs websocket
2 participants