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

Example requests and responses are too dummy on JSON-RPC SPEC page #11384

Closed
1 of 2 tasks
Amit0617 opened this issue Oct 6, 2023 · 6 comments · Fixed by #13516
Closed
1 of 2 tasks

Example requests and responses are too dummy on JSON-RPC SPEC page #11384

Amit0617 opened this issue Oct 6, 2023 · 6 comments · Fixed by #13516
Labels
bug 🐛 Something isn't working question ❓ Further information is requested request for comments 🗣️ A request for comments has been made; discussion and input is encouraged Status: Stale This issue is stale because it has been open 30 days with no activity.

Comments

@Amit0617
Copy link
Contributor

Amit0617 commented Oct 6, 2023

Describe the bug

There are various kinds of requests and responses on json-rpc spec page. I understand they are for the purpose of giving structure of request and responses but it would be a good idea that responses are of mentioned request.
Mainly there should be such requests which can give desired kind of responses.

To reproduce

Try eth_getBalance and you would find following response

{"jsonrpc":"2.0","id":1,"result":"0x0"}                                             

Expected behavior

Mentioned response is expected i.e.,

{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x0234c8a3397aab58" // 158972490234375000
}

Screenshots

No response

Desktop (please complete the following information)

No response

Smartphone (please complete the following information)

No response

Additional context

No response

Would you like to work on this issue?

  • Yes
  • No
@Amit0617 Amit0617 added the bug 🐛 Something isn't working label Oct 6, 2023
@github-actions github-actions bot added the needs triage 📥 This issue needs triaged before being worked on label Oct 6, 2023
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Status: Stale This issue is stale because it has been open 30 days with no activity. label Nov 21, 2023
@wackerow
Copy link
Member

Hey @Amit0617! Thanks for posting, and sorry for delays getting back to you.

Looks like you're referring to the // Result being shown in the example and how it doesn't match the actual RPC call (0x0234c8a3397aab58 vs 0x0)? These values are currently hard-coded in the markdown files as just examples, so they wouldn't match an actual RPC call.

Any thoughts on how you'd like to see this fixed?

@wackerow wackerow added question ❓ Further information is requested request for comments 🗣️ A request for comments has been made; discussion and input is encouraged and removed Status: Stale This issue is stale because it has been open 30 days with no activity. needs triage 📥 This issue needs triaged before being worked on labels Jun 13, 2024
@Amit0617
Copy link
Contributor Author

Amit0617 commented Jun 13, 2024

Yes, my main concern was they are just completely dummy values. While that is not a big issue for someone who is just reviewing and learning about this first time. However, people who will be reading specs and build tooling around it, will try to use those parameters as an example to test their tooling. They will also try to match corresponding responses with it.
So, I was mainly suggesting using examples which will have some real responses. For example, instead of using random 32 characters, random hex, an original block hash should be used. Likewise, instead of random 20 characters hex, use 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 (vitalik.eth) or any real address.

@Amit0617
Copy link
Contributor Author

I recently saw, there is a new section added JSON-RPC API playground which already accomplishes what was expected through this issue. Maybe now, we don't need to care about it any more.

@corwintines
Copy link
Member

@Amit0617 open to these changes if you would like to take this on. I would just er on the side of standardized values kind of like you said (vitalik.eth is used all over the place with other projects I notice for example).

Copy link
Contributor

github-actions bot commented Aug 3, 2024

This issue is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the Status: Stale This issue is stale because it has been open 30 days with no activity. label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working question ❓ Further information is requested request for comments 🗣️ A request for comments has been made; discussion and input is encouraged Status: Stale This issue is stale because it has been open 30 days with no activity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants