Skip to content

Conversation

@AurelienRichez
Copy link
Contributor

Description

The goal of this PR is to put the read only part of Blockchain in another class in order to reduce the dependency on this class. As a target I choose to make BlockchainHostActor independent of Blockchain.

I moved a few function inside a new class named BlockchainReader for consistency, but we could come up with another name.

It allowed to remove Blockchain at some other places but there are still read only methods that can be moved to go further. But as it is already a big change we should at least validate this before continuing.

review

This is a big change, but mostly moving things around. Each commit can be viewed one by one and is mergeable, so we can split this PR if needed

One important thing to think about is : does the change help us for a future refactoring ? I don't necessarily see BlockchainReader as a final target for the structure of the code, but more as step to help us refactor step by step.

@AurelienRichez AurelienRichez force-pushed the refactor/ETCM-943-split-reading-part branch from 7f44df2 to 13c47db Compare June 23, 2021 07:58
}
import io.iohk.ethereum.mpt.MptNode

class BlockchainReader(
Copy link
Contributor

Choose a reason for hiding this comment

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

would the next step be to create a trait BlockchainReader to allow for easier stubbing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I agree. In the end we might split it further and have several reader traits.

@AurelienRichez AurelienRichez force-pushed the refactor/ETCM-943-split-reading-part branch from da39ad5 to a9a194a Compare June 25, 2021 07:52
@AurelienRichez AurelienRichez force-pushed the refactor/ETCM-943-split-reading-part branch from a9a194a to e54ad4f Compare June 28, 2021 07:08
@AurelienRichez AurelienRichez force-pushed the refactor/ETCM-943-split-reading-part branch from d3bc48d to 3b4a0cd Compare June 28, 2021 08:56
@AurelienRichez AurelienRichez merged commit e631789 into develop Jun 28, 2021
@AurelienRichez AurelienRichez deleted the refactor/ETCM-943-split-reading-part branch June 28, 2021 09:29
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.

5 participants