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

Make jsonrpc protocol version field in Response as Option #1046

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

gnapoli23
Copy link
Contributor

@gnapoli23 gnapoli23 commented Mar 15, 2023

Problem

JSON-RPC 2.0 specification does not require jsonrpc version in responses as a mandatory field: JSON-RPC 2.0 Spec
For RPC servers that put this value to null, the lib can't deserialize this responses, 'cause it actually requires this field to be present

Solution

Make jsonrpc field in Response as Option.

Fixes #1045

@gnapoli23 gnapoli23 requested a review from a team as a code owner March 15, 2023 11:22
types/src/response.rs Outdated Show resolved Hide resolved
@gnapoli23
Copy link
Contributor Author

Btw don't know why the CI failed for last commit but I tested in local and everything goes well. Maybe a re-run of the CI can be a better shot :)

@niklasad1
Copy link
Member

niklasad1 commented Mar 15, 2023

Btw don't know why the CI failed for last commit but I tested in local and everything goes well. Maybe a re-run of the CI can be a better shot :)

Don't worry the gitlab pipeline has an old rustc version running, we will update it soon that's why it fails

@niklasad1 niklasad1 merged commit ef3ec69 into paritytech:master Mar 16, 2023
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.

RPC Response: error while deserializing response for missing jsonrpc version field
3 participants