-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
NewSnapshotReader Nil Error #2586
NewSnapshotReader Nil Error #2586
Conversation
core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_test.go
Outdated
Show resolved
Hide resolved
9a3d9fc
to
499cca6
Compare
My suggestion was to simply add the following code in the test file at line 535.
|
Right, however the changes I've made to snapshot.go have caused some of the existing test cases to fail since they are missing either public state or private state hashes. Because of the addition of a new error being thrown if files are missing, they will fail since they are not expecting this new error. I thought that it'd be best to then test these test cases with missing files separately which ends up covering the addition you suggested. What are your thoughts on this? |
My suggestion would be to fix the input to the existing test. |
Upon further discussion the nil response is expected in some scenarios (such as no private state data) so we can simply leave the functionality as-is and improve the comments and logging to make the intended use more clear. |
499cca6
to
50092cb
Compare
return nil, errors.WithMessage(err, "error while checking if data file exists") | ||
} | ||
if !exist { | ||
log.Printf("Snapshot data file name does not exist") |
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.
log.Printf("Snapshot data file name does not exist") | |
logger.Infow("Data file does not exist. Nothing to be done.", "filepath", dataFilePath) |
FAB-18469 Signed-off-by: Julian Castrence <[email protected]>
50092cb
to
7a6fec8
Compare
Type of change
Description
Related issues