-
Notifications
You must be signed in to change notification settings - Fork 724
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
Ban usage of require.Error #1346
Conversation
x/merkledb/history_test.go
Outdated
_, err = db.history.getValueChanges(toBeDeletedRoot, endRoot, nil, nil, 1) | ||
require.Error(err, ErrRootIDNotPresent) | ||
require.ErrorIs(err, ErrStartRootNotFound) |
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.
@dboehm-avalabs this error wasn't correct - lmk if this error is unexpected.
sharedMemory atomic.SharedMemory | ||
sourceKeys []*secp256k1.PrivateKey | ||
timestamp time.Time | ||
expectedBuildError error |
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.
nit: can we do expectedErr
since we're only testing build?
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.
🏆
Why this should be merged
Tests using
require.Error
can be subtly incorrect because an unexpected error may be returned.How this works
Bans the usage of
require.Error
and removes all usage ofrequire.Error
How this was tested
CI