8000 Add header number check to GetRewards by ian0371 · Pull Request #1727 · klaytn/klaytn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Add header number check to GetRewards #1727

Merged
merged 1 commit into from
Nov 28, 2022
Merged

Conversation

ian0371
Copy link
Contributor
@ian0371 ian0371 commented Nov 25, 2022

Proposed changes

This PR changes klay_getRewards() API to return an error if the given block number does not exist

For the following request,

$ curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method": "klay_getRewards", "params": ["0x100000"], "id": 1}' http://localhost:8551/

Response (Before):

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"method handler crashed"}}

Response (After):

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"the block does not exist (block number: 1048576)"}}

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@ian0371 ian0371 added the need to merge Need to merge for the next time label Nov 25, 2022
@ian0371 ian0371 added this to the v1.10 (Kore) milestone Nov 25, 2022
@ian0371 ian0371 self-assigned this Nov 25, 2022
@ian0371 ian0371 merged commit 96c9b0a into klaytn:dev Nov 28, 2022
@blukat29 blukat29 removed the need to merge Need to merge for the next time label Nov 28, 2022
@blukat29 blukat29 mentioned this pull request Dec 1, 2022
31 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0