Skip to content

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

Merged
AurelienRichez merged 5 commits intodevelopfrom
refactor/ETCM-969-move-getBestBlock
Jul 7, 2021
Merged

[ETCM-969] move best block and genesis functions to blockchain reader#1036
AurelienRichez merged 5 commits intodevelopfrom
refactor/ETCM-969-move-getBestBlock

Conversation

@AurelienRichez
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment thread src/main/scala/io/iohk/ethereum/testmode/TestModeComponentsProvider.scala Outdated
@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