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

Remove ChainFragment #2778

Merged
merged 1 commit into from
Nov 30, 2020
Merged

Remove ChainFragment #2778

merged 1 commit into from
Nov 30, 2020

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Nov 27, 2020

ChainFragments were hardly ever used anymore, only in some tests. We use
AnchoredFragments almost everywhere. There are very few situations in which
you don't want an anchor.

This means that ChainFragments are only really there to make implementing
AnchoredFragments easier, i.e., by wrapping them. However, we can simply
inline them, dropping tons of code in the process.

In the process, simplify the chain and fragment generators. Drop a few pattern
synonyms. Stop using block number 0 for genesis and remove legacyHeadBlockNo.

@mrBliss mrBliss requested review from coot and edsko November 27, 2020 11:45
@mrBliss mrBliss force-pushed the mrBliss/remove-chainfragment branch 2 times, most recently from 010778d to d45af33 Compare November 27, 2020 15:34
@mrBliss
Copy link
Contributor Author

mrBliss commented Nov 27, 2020

I added the prop_sliceRange that I forgot about. There were no other tests for the ChainFragment that needed to be ported over.

Copy link
Contributor

@edsko edsko left a comment

Choose a reason for hiding this comment

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

Nice, good that cleaned up a bit.

`ChainFragment`s were hardly ever used anymore, only in some tests. We use
`AnchoredFragment`s almost everywhere. There are very few situations in which
you *don't* want an anchor.

This means that `ChainFragment`s are only really there to make implementing
`AnchoredFragment`s easier, i.e., by wrapping them. However, we can simply
inline them, dropping tons of code in the process.

In the process, simplify the chain and fragment generators. Drop a few pattern
synonyms. Stop using block number 0 for genesis and remove `legacyHeadBlockNo`.
@mrBliss
Copy link
Contributor Author

mrBliss commented Nov 30, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 30, 2020

@iohk-bors iohk-bors bot merged commit e8d526b into master Nov 30, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/remove-chainfragment branch November 30, 2020 16:56
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.

2 participants