Closed Kbhat1 closed 2 weeks ago
Attention: Patch coverage is 60.00000%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 60.94%. Comparing base (
e8e4b3b
) to head (8ff550d
). Report is 81 commits behind head on main.
Describe your changes and provide context
getBlockReceipts
, it errs out withinvalid argument 0: hex number \u003e 64 bits"
getBlockReceipts
to accept block hash on top of block height or tag (latest)rpc.BlockNumberOrHash
type and now can accept the block hash to query a receipt(1) Query receipt by block height: curl http://localhost:8545/ -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBlockReceipts","params":["0x4f1838f"],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":[{"blockHash":"0x919af336f37dffe608316648a9e970e02eb3ec4e531469567003e1534bfd3cc3","blockNumber":"0x4f1838f","contractAddress":null,"cumulativeGasUsed":"0x0","effectiveGasPrice":"0x47868c00","from":"0x339d413ccefd986b1b3647a9cfa9cbbe70a30749","gasUsed":"0x947d","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x3c2269811836af69497e5f486a85d7316753cf62","transactionHash":"0xb34638943eb6162e56a026ccfad4be7bd0988ef6ca6794ba750746db5531dbea","transactionIndex":"0x0","type":"0x0"}]}
(2) Query receipt by block hash curl http://localhost:8545/ -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBlockReceipts","params":["0x919af336f37dffe608316648a9e970e02eb3ec4e531469567003e1534bfd3cc3"],"id":1,"jsonrpc":"2.0"}'
{"jsonrpc":"2.0","id":1,"result":[{"blockHash":"0x919af336f37dffe608316648a9e970e02eb3ec4e531469567003e1534bfd3cc3","blockNumber":"0x4f1838f","contractAddress":null,"cumulativeGasUsed":"0x0","effectiveGasPrice":"0x47868c00","from":"0x339d413ccefd986b1b3647a9cfa9cbbe70a30749","gasUsed":"0x947d","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x3c2269811836af69497e5f486a85d7316753cf62","transactionHash":"0xb34638943eb6162e56a026ccfad4be7bd0988ef6ca6794ba750746db5531dbea","transactionIndex":"0x0","type":"0x0"}]}
Confirmed running with
latest
tag works as well: (ran a script running following commandcurl http://localhost:8545/ -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBlockReceipts","params":["latest"],"id":1,"jsonrpc":"2.0"}'
)Testing performed to validate your change