-
Notifications
You must be signed in to change notification settings - Fork 38.6k
refactor: Take Span in SetSeed #23409
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
This makes calling code less verbose and less fragile. Also, by adding the CKey::data() member function, it is now possible to call HexStr() with a CKey object.
|
utACK fa93ef5 |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
| BOOST_CHECK_MESSAGE(privkey.IsValid(), "!IsValid:" + strTest); | ||
| BOOST_CHECK_MESSAGE(privkey.IsCompressed() == isCompressed, "compressed mismatch:" + strTest); | ||
| BOOST_CHECK_MESSAGE(privkey.size() == exp_payload.size() && std::equal(privkey.begin(), privkey.end(), exp_payload.begin()), "key mismatch:" + strTest); | ||
| BOOST_CHECK_MESSAGE(Span<const uint8_t>{privkey} == Span<const uint8_t>{exp_payload}, "key mismatch:" + strTest); |
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.
Note that C++20's std::span doesn't offer comparison operations (like operator==), i.e. we'll have to implement them ourselves as soon as we switch from Span to std::span (see e.g. https://brevzin.github.io/c++/2020/03/30/span-comparisons/ for anyone being interested in the topic).
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.
Or as alternative, revert this hunk if this is the only use of operator== at the time
theStack
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.
Code-review ACK fa93ef5
|
Code review ACK fa93ef5 |
fa93ef5 refactor: Take Span in SetSeed (MarcoFalke) Pull request description: This makes calling code less verbose and less fragile. Also, by adding the CKey::data() member function, it is now possible to call HexStr() with a CKey object. ACKs for top commit: sipa: utACK fa93ef5 laanwj: Code review ACK fa93ef5 theStack: Code-review ACK fa93ef5 Tree-SHA512: 73fb999320719ad4b9ab5544018a7a083d140545c2807ee3582ecf7f441040a30b5157e85790b6b840af82f002a7faf30bd8162ebba5caaf2067391c43dc7e25
|
Closing manually because github doesn't seem to do it automatically. |
fa93ef5 refactor: Take Span in SetSeed (MarcoFalke) Pull request description: This makes calling code less verbose and less fragile. Also, by adding the CKey::data() member function, it is now possible to call HexStr() with a CKey object. ACKs for top commit: sipa: utACK fa93ef5 laanwj: Code review ACK fa93ef5 theStack: Code-review ACK fa93ef5 Tree-SHA512: 73fb999320719ad4b9ab5544018a7a083d140545c2807ee3582ecf7f441040a30b5157e85790b6b840af82f002a7faf30bd8162ebba5caaf2067391c43dc7e25
This makes calling code less verbose and less fragile. Also, by adding
the CKey::data() member function, it is now possible to call HexStr()
with a CKey object.