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

Use Examples Returning Non-Trivial Response #11320

Merged
merged 4 commits into from
Mar 29, 2024
Merged

Conversation

bh2smith
Copy link
Contributor

@bh2smith bh2smith commented Sep 30, 2023

I was testing out these endpoints and found it confusing that the example values return unexpected response:

curl -X POST $NODE_URL \
   --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["0x29c", "0x0"],"id":1}'

{"jsonrpc":"2.0","id":1,"result":null}%

Turns out that block 668 contains no transactions: cf https://etherscan.io/block/668

So I picked an example transaction that actually exists. It is the transaction with the highest total fee paid (10_668 ETH) -- cf Dune Analytics.

Test Plan

Observe that:

curl -X POST $NODE_URL \
   --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["0x9c47cf", "0x24"],"id":1}'

returns

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x06698ca6eea2b9e6223e5bce41a142796d8845e4147a74356437054e3949fb06",
    "blockNumber": "0x9c47cf",
    "chainId": "0x1",
    "from": "0xcdd6a2b9dd3e386c8cd4a7ada5cab2f1c561182d",
    "gas": "0x5208",
    "gasPrice": "0x70ce7011fc4d400",
    "hash": "0xc215b9356db58ce05412439f49a842f8a3abe6c1792ff8f2c3ee425c3501023c",
    "input": "0x",
    "nonce": "0x458",
    "r": "0x35c4421e50b5eaaee32c65327e06feaba60c31c1f8b2656734e93c4469d71c0d",
    "s": "0x24360f723767dfa26896dce8a37671585eea2bc6f6eadf4d2c56306e2b51c5b3",
    "to": "0xe87fda75fec7063c3d2bef6dc4f17c008b098c30",
    "transactionIndex": "0x24",
    "type": "0x0",
    "v": "0x25",
    "value": "0x12f939c99edab80000"
  }
}

@gatsby-cloud
Copy link

gatsby-cloud bot commented Sep 30, 2023

✅ ethereum-org-website-dev deploy preview ready

Copy link
Contributor

@minimalsm minimalsm left a comment

Choose a reason for hiding this comment

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

Thanks @bh2smith!

Makes sense to me, @jmcook1186 what do you think?

Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

image

Can confirm this looks good, just going to update the curl example with the same and pull this in, and also update on non-English pages. Good catch, thanks @bh2smith

@@ -1245,8 +1245,8 @@ Returns information about a transaction by block number and transaction index po

```js
params: [
"0x29c", // 668
Copy link
Member

Choose a reason for hiding this comment

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

lol 😆 That's really funny that this example had no transactions... rugged!

src/content/developers/docs/apis/json-rpc/index.md Outdated Show resolved Hide resolved
@wackerow wackerow merged commit c3c36b3 into ethereum:dev Mar 29, 2024
2 checks passed
@wackerow
Copy link
Member

@all-contributors please add @bh2smith for bug fix

Copy link

gitpoap-bot bot commented Mar 29, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

Be sure to join the Ethereum.org discord if you are interested in contributing further to the project or have any questions for the team.

GitPOAP: 2024 Ethereum.org Contributor:

GitPOAP: 2024 Ethereum.org Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

Copy link
Contributor

@wackerow

I've put up a pull request to add @bh2smith! 🎉

This was referenced Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants