Skip to content

[ETCM-939] refactor Ledger (by removing it) #1026

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

Merged
merged 24 commits into from
Jun 29, 2021

Conversation

jvdp
Copy link
Contributor

@jvdp jvdp commented Jun 23, 2021

It's been a journey; it looks easy enough on the src/main side but lots of stuff in src/test unfortunately broke along the way. The commits mostly tell a story of getting more tests passing while moving stuff out of Ledger gradually.

Copy link
Contributor

@lukasz-golebiewski lukasz-golebiewski left a comment

Choose a reason for hiding this comment

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

Looks good overall, aside from some commented out code that could be removed

@leo-bogastry
Copy link
Contributor

A description of what you did with the stuff that was in the Ledger would be nice

Copy link
Contributor

@AnastasiiaL AnastasiiaL left a comment

Choose a reason for hiding this comment

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

nice to see tests simplified 👍

@jvdp
Copy link
Contributor Author

jvdp commented Jun 28, 2021

A description of what you did with the stuff that was in the Ledger would be nice

Basically it was a layer that didn't add much except for complexity. I looked at the dependents and made the following changes:

  • passed Consensus directly wherever that attribute was used
  • checkBlockStatus wasn't used at all (removed)
  • getBlockByHash was only used in CheckpointingService, logic was moved there
  • importBlock was moved to the BlockImport class (it was very tightly coupled to it anyway)
  • resolveBranch delegated directly to BranchResolution so this was just inlined in the one place it was used

The types aliases and case classes were moved to a package object and their own files respectively.

@jvdp jvdp merged commit e3f1c38 into develop Jun 29, 2021
@jvdp jvdp deleted the feature/ETCM-939-refactor-ledger branch June 29, 2021 08:22
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