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

id field of JSON-RPC response value is different from request value #582

Open
zeroFruit opened this issue Jul 18, 2020 · 1 comment
Open

Comments

@zeroFruit
Copy link

zeroFruit commented Jul 18, 2020

I found that the id field of response value of JSON-RPC is different from id value of request.

Request

curl --request POST 'localhost:18332' \
--header 'Content-Type: application/json' \
--data-raw '{
	"id": "1",
	"jsonrpc": "2.0",
	"method": "getblockhash",
	"params": [1781013]
}'

Response

{
    "jsonrpc": "2.0",
    "result": "00000000b5b4d6d42163e5441fd1514a6f4f25523968090a2a5049a03efcd1f5",
    "id": 1
}

Problem

The value is same but type is different


FYI

  • req: "id": 1 ➡️ res: "id": 1 This works.
  • req: "id": "foo" ➡️ res: "id": "foo" This works
@zeroFruit zeroFruit changed the title id field of JSON-RPC response value is different with request value id field of JSON-RPC response value is different from request value Jul 18, 2020
svyatonik added a commit that referenced this issue Jul 21, 2020
@svyatonik
Copy link
Contributor

Thank you for the report! This could be solved by simply updating jsonrpc references. But it isn't that simple now - we are too far beyond master oof a lot of crates + some crates are obsolete and we should switch to some others :/ As a workaround, you may use this branch - it fixes your problem. Me or someone else will try to look at updating dependencies at some point in the future.

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

No branches or pull requests

2 participants