Update select_first_candidate to return InternalSelectionError::Empty#542
Conversation
|
Hi there! I'm new here. I didn't see this covered in any existing tests, unless you'd like me to add one? |
|
If you are up to adding a test that'd be a welcome addition |
Pull Request Test Coverage Report for Build 14044611583Details
💛 - Coveralls |
|
Also, currently we actually check for an empty candidates set twice: the first one is here. So this specific code change would be unreachable unless calling |
|
Yes please remove the empty check in |
c113c09 to
57d21c0
Compare
|
I made the requested changes. |
|
@pseudoramdom Do you mind squashing your commits into one? |
benalleng
left a comment
There was a problem hiding this comment.
Just a small nit to keep the test signatures consistent
c5aa1ea to
5066eef
Compare
spacebear21
left a comment
There was a problem hiding this comment.
ACK 5066eef
Thanks @pseudoramdom and reviewers!
nit: looks like all previous commit messages got squashed into this one, it would be nice to clean up the commit message before merging this. We generally follow the commit guidelines established in https://cbea.ms/git-commit/
DanGould
left a comment
There was a problem hiding this comment.
LGTM other than the commit messages. Please follow the seven rules from cbeams.
Thank you for your contribution 😎
5066eef to
25d2af5
Compare
|
Thanks for the reviews folks! Fixed the commit message. Let me know if it looks good. |
There was a problem hiding this comment.
Thanks for the update. I think there is one sincere issue with the test, as discovered by @elnosh in another PR that I've repeated in my comments below.
I would like to understand the rationale of the change in the PR body, in complete sentences, rather than just a repeat of the title. The commit message is closer but I still need it to follow the seven rules, namely 2, 6, and 7, seem broken to me. Much more important than the what is the why, or rationale for the change.
25d2af5 to
b37bdce
Compare
f01e357 to
4c3c70e
Compare
Fixes payjoin#535. If there are no candidates, it should return `InternalSelectionError::Empty` instead of `NotFound`. The check in try_preserving_privacy was redundant so it is removed.
4c3c70e to
96fe0c0
Compare
|
Fixed the commit message and removed the redundant |
Fix #535
Update
select_first_candidateto returnInternalSelectionError::Emptywhen there are no candidates available for selection