-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Encapsulate validate_header_regarding_parent
inside SealedHeader
#6404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this a lot, this is much better than having standalone functions.
some naming nits otherwise lgtm
pending @Rjected
…ger/reth into validate_regarding_parent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, pending @Rjected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I like that this puts the header validation errors in a new type
Changes Made
This pull request encapsulates the
validate_header_regarding_parent
function within theSealedHeader
struct. The encapsulation is done to improve code organization and enhance encapsulation of header-related validation logic.validate_header_regarding_parent
are mapped inside aSealedHeaderError
enum.SealedHeaderError
is introduced insideConsensusError
enum, transparently wrappingSealedHeaderError
ConsensusError
error fields that are wrapped insideSealedHeaderError
are removed fromConsensusError
enum to clean up and better organize errors there.Should close #6193.
Motivation
Encapsulating
validate_header_regarding_parent
withinSealedHeader
promotes a cleaner code structure by keeping related functionality within the same module. This encapsulation enhances the readability and maintainability of the codebase.Impact
This change does not introduce any functional changes but improves the organization of the code. Existing functionality remains unchanged, and this encapsulation serves as a step towards better code organization.