-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Storehouse - Bootstrap] Refactor checkpoint reader with WithFile #4815
Conversation
da4af82
to
646306b
Compare
if err != nil { | ||
return fmt.Errorf("cannot read sub trie node count: %w", err) | ||
} | ||
nodesCount, expectedSum, err := readSubTriesFooter(f) |
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.
if err != nil { | ||
return fmt.Errorf("cannot read sub trie node count: %w", err) | ||
} | ||
nodesCount, expectedSum, err := readSubTriesFooter(f) |
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.
better to review these changes with "Hide Whitespace" option on
@@ -738,3 +738,24 @@ func closeAndMergeError(closable io.Closer, err error) error { | |||
|
|||
return merr.ErrorOrNil() | |||
} | |||
|
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.
could we add a comment explaining what it does?
592bba1
to
e9c3d8a
Compare
This PR extracts a withFile function to be used for handling file opening and closing when reading checkpoint files.
Addressing review comment from #4811 (comment)