-
Notifications
You must be signed in to change notification settings - Fork 169
Actually return the error #366
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
Conversation
|
Lol!! Could you add a unit test? |
We have what appears to be an error return but do not actually return the error. This line needs an explicit `return` statement otherwise it is a noop.
The `SortedMultiVec` constructor appears to have a bug in it, add a unit test to trigger the bug.
apoelstra
left a comment
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.
ACK 4d0e8fb
|
Damn this merged, I was thinking last night that this unit test shouldn't be merged. Its informational but not useful to maintain. We do not explicitly unit test every error path in the code so it seems odd to have this one. Not to worry. |
|
I would prefer if we did unit test every error path :) |
| pub fn new(k: usize, pks: Vec<Pk>) -> Result<Self, Error> { | ||
| // A sortedmulti() is only defined for <= 20 keys (it maps to CHECKMULTISIG) | ||
| if pks.len() > MAX_PUBKEYS_PER_MULTISIG { | ||
| Error::BadDescriptor("Too many public keys".to_string()); |
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.
post-merge comment: Does Clippy warn about this?
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 think you just need to upgrade to 2018 edition. It's a standard warning now: #[must_use]
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.
Does Clippy warn about this?
ooo you got me, usually I always mention 'found by clippy' in the commit log but I forgot this time.
I think you just need to upgrade to 2018 edition
The PR is open!
4d0e8fb7692a49dd140fa34711ef53a9f31b357a Add unit test SortedMultiVec constructor (Tobin C. Harding)
fb932f666be3b0dceab7258f5e63ed7aa9951a52 Actually return the error (Tobin C. Harding)
Pull request description:
We have what appears to be an error return but do not actually return
the error. This line needs an explicit `return` statement otherwise it
is a noop.
ACKs for top commit:
apoelstra:
ACK 4d0e8fb7692a49dd140fa34711ef53a9f31b357a
Tree-SHA512: 7a79b678fb77e092415b78857a5b0bfd2b4cf58382858729f2e6c2d57d8c6b50fabcbe498fd12fee05d9886574a545ad568310df76609fe2eb123af861c4ad14
We have what appears to be an error return but do not actually return
the error. This line needs an explicit
returnstatement otherwise itis a noop.