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

Fix/rpc request serde #1539

Merged
merged 5 commits into from
Jan 13, 2022
Merged

Conversation

whalelephant
Copy link
Contributor

Motivation

Closes #1369 without introducing new dependencies with jsonrpc-* crates.

There is an issue with parsing numerical value with json rpc id field. The work around implemented is to first parse into serde_json::Value as suggested here.

Another PR to the temp dependency json-rpc-type fixes the issue of how serde_json::Value string deserialization requires escaping and cannot therefore be cast to a borrowed str type.

Test Plan

 curl -s -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"latestblockheight","params":[],"id":"1"}' localhost:3032
 
 curl -s -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"latestblockheight","params":[],"id":1}' localhost:3032

Related PRs

#1496
#1537

@ljedrz
Copy link
Collaborator

ljedrz commented Jan 10, 2022

The CI doesn't want to start; I'll try reopening, it sometimes helps.

@ljedrz ljedrz closed this Jan 10, 2022
@ljedrz ljedrz reopened this Jan 10, 2022
@ljedrz
Copy link
Collaborator

ljedrz commented Jan 10, 2022

Did it get stuck again? Let me retry.

@ljedrz ljedrz closed this Jan 10, 2022
@ljedrz ljedrz reopened this Jan 10, 2022
Copy link
Collaborator

@ljedrz ljedrz left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ljedrz ljedrz added RPC RPC-related issues testnet2 labels Jan 11, 2022
Copy link
Contributor

@raychu86 raychu86 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC RPC-related issues testnet2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Numeric id not supported anymore in JSON RPC call
3 participants