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

[ETCM-969] move best block and genesis functions to blockchain reader #1036

Merged
merged 5 commits into from
Jul 7, 2021

Conversation

AurelienRichez
Copy link
Contributor

Description

Sorry for the long PR. This PR is a prerequisite for ETCM-969. It moves some part of blockchain to the BlockchainReader and I will open a second PR will use that to create a "blockchain instance" interface.

The changes are :

  • move getBestBlock and getBestBlockNumber to BlockchainReader
  • move genesis related function to BlockchainReader

It also has a common part with #1035 regarding blockchain metadata. I kept the same naming so that the conflict are easy to fix if any.

assert(peer1.blockchainReader.getBestBlock().get.hash == peer2.blockchainReader.getBestBlock().get.hash)
val peer1BestBlockNumber = peer1.blockchainReader.getBestBlock().get.number
val peer2BestBlockNumber = peer2.blockchainReader.getBestBlock().get.number
assert(peer1BestBlockNumber == peer2BestBlockNumber && peer1BestBlockNumber == length)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@AurelienRichez AurelienRichez force-pushed the refactor/ETCM-969-move-getBestBlock branch from 45bfb31 to d123b39 Compare July 7, 2021 12:55
@AurelienRichez AurelienRichez force-pushed the refactor/ETCM-969-move-getBestBlock branch from d123b39 to fbf9ab8 Compare July 7, 2021 12:56
@AurelienRichez AurelienRichez merged commit 41d2442 into develop Jul 7, 2021
@AurelienRichez AurelienRichez deleted the refactor/ETCM-969-move-getBestBlock branch July 7, 2021 13:37
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