-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat(internal/client): Implement read only BlockState
for ClientAdapter
#4549
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17e4e54
to
3c55321
Compare
Base automatically changed from
diego/client_translation_shim
to
development
February 19, 2025 13:06
8f7d740
to
fd604e9
Compare
7f2700e
to
01a0257
Compare
timwu20
approved these changes
Feb 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff!
EclesioMeloJunior
approved these changes
Feb 26, 2025
01a0257
to
56f528e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Implement read only methods from
BlockState
inClientAdapter
BlockState
BestBlock() (*types.Block, error)
BestBlockHash() common.Hash
BestBlockHeader() (*types.Header, error)
BestBlockNumber() (number uint, err error)
GenesisHash() common.Hash
GetBlockBody(hash common.Hash) (*types.Body, error)
GetBlockStateRoot(bhash common.Hash) (common.Hash, error)
GetBlockByHash(common.Hash) (*types.Block, error)
GetBlockByNumber(blockNumber uint) (*types.Block, error)
GetFinalisedHeader(round, setID uint64) (*types.Header, error)
GetFinalisedHash(round, setID uint64) (common.Hash, error)
GetHashesByNumber(blockNumber uint) ([]common.Hash, error)
GetHashByNumber(blockNumber uint) (common.Hash, error)
GetHeader(bhash common.Hash) (*types.Header, error)
GetHeaderByNumber(num uint) (*types.Header, error)
GetHighestFinalisedHeader() (*types.Header, error)
GetHighestFinalisedHash() (common.Hash, error)
GetHighestRoundAndSetID() (uint64, uint64, error)
GetJustification(common.Hash) ([]byte, error)
GetNonFinalisedBlocks() []common.Hash
GetSlotForBlock(common.Hash) (uint64, error)
HasFinalisedBlock(round, setID uint64) (bool, error)
HasHeader(hash common.Hash) (bool, error)
HasJustification(hash common.Hash) (bool, error)
HasHeaderInDatabase(hash common.Hash) (bool, error)
NumberIsFinalised(blockNumber uint) (bool, error)
Tests
make test
Issues
Closes: #4461