Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Nov 1, 2021

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.

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.
@sipa
Copy link
Member

sipa commented Nov 1, 2021

utACK fa93ef5

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 3, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23417 (wallet, spkm: Move key management from DescriptorScriptPubKeyMan to wallet level KeyManager by achow101)
  • #22341 (rpc: add getxpub by Sjors)

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);
Copy link
Contributor

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).

Copy link
Member Author

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

Copy link
Contributor

@theStack theStack left a 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

@laanwj
Copy link
Member

laanwj commented Nov 8, 2021

Code review ACK fa93ef5

laanwj added a commit to bitcoin-core/gui that referenced this pull request Nov 8, 2021
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
@laanwj
Copy link
Member

laanwj commented Nov 8, 2021

Closing manually because github doesn't seem to do it automatically.

@laanwj laanwj closed this Nov 8, 2021
@maflcko maflcko deleted the 2111-refKey branch November 8, 2021 12:21
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 8, 2021
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
@bitcoin bitcoin locked and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants