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

Implemented GetHeaderByNumber and GetHeaderByHash #149

Merged
merged 29 commits into from
Mar 27, 2024

Conversation

novosandara
Copy link

@novosandara novosandara commented Mar 8, 2024

Description

Implemented methods: eth_getHeaderByNumber, eth_getHeaderByHash, eth_getBlockReceipts and eth_createAccessList.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Breaking changes

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

Please complete this section if you ran manual tests for this functionality, otherwise delete it

Documentation update

Please link the documentation update PR in this section if it's present, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

jsonrpc/txpool_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/types.go Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
@novosandara novosandara marked this pull request as ready for review March 15, 2024 11:06
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Show resolved Hide resolved
state/executor.go Outdated Show resolved Hide resolved
jsonrpc/types.go Show resolved Hide resolved
jsonrpc/types.go Outdated Show resolved Hide resolved
jsonrpc/types.go Outdated Show resolved Hide resolved
jsonrpc/txpool_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/txpool_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
jsonrpc/types.go Outdated Show resolved Hide resolved
@goran-ethernal
Copy link
Collaborator

We could add these new functions to the TestE2E_JsonRPC e2e test. Even though they do not exist as type functions in the eth client, you can still call them like this:

var header types.Header
err := jsonRPC.Call("eth_getHeaderByNumber", &header, 10)

var header types.Header
err := jsonRPC.Call("eth_getHeaderByHash", &header, someHash)

var receipts []ethgo.Receipt
err = jsonRPC.Call("eth_getBlockReceipts", &receipts, 10)

var contentFrom map[string]map[string]*ethgo.Transaction
err = jsonRPC.Call("eth_contentFrom", &contentFrom, someAddress)

CreateAccessList is a bit tricky, since you need to call some contract here, but you can let's say, call a function stake on the StakeManager contract by some validator.

jsonrpc/txpool_endpoint_test.go Outdated Show resolved Hide resolved
@Stefan-Ethernal Stefan-Ethernal merged commit c8b4771 into develop Mar 27, 2024
10 checks passed
@Stefan-Ethernal Stefan-Ethernal deleted the implementing_methods_eth_txpool branch March 27, 2024 07:45
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

Successfully merging this pull request may close these issues.

3 participants