Bitcoin Core 28.99.0
P2P Digital Currency
|
Converts a mocked descriptor string to a valid one. More...
#include <descriptor.h>
Public Member Functions | |
bool | IdIsCompPubKey (uint8_t idx) const |
bool | IdIsUnCompPubKey (uint8_t idx) const |
bool | IdIsXOnlyPubKey (uint8_t idx) const |
bool | IdIsConstPrivKey (uint8_t idx) const |
bool | IdIsXpub (uint8_t idx) const |
bool | IdIsXprv (uint8_t idx) const |
void | Init () |
When initializing the target, populate the list of keys. More... | |
std::optional< uint8_t > | IdxFromHex (std::string_view hex_characters) const |
Parse an id in the keys vectors from a 2-characters hex string. More... | |
std::optional< std::string > | GetDescriptor (std::string_view mocked_desc) const |
Get an actual descriptor string from a descriptor string whose keys were mocked. More... | |
Private Attributes | |
std::array< std::string, TOTAL_KEYS_GENERATED > | keys_str |
256 keys of various types. More... | |
Static Private Attributes | |
static constexpr uint8_t | KEY_TYPES_COUNT {6} |
Types are raw (un)compressed pubkeys, raw xonly pubkeys, raw privkeys (WIF), xpubs, xprvs. More... | |
static constexpr size_t | TOTAL_KEYS_GENERATED {std::numeric_limits<uint8_t>::max() + 1} |
How many keys we'll generate in total. More... | |
Converts a mocked descriptor string to a valid one.
Every key in a mocked descriptor key is represented by 2 hex characters preceded by the '' character. We parse the two hex characters as an index in a list of pre-generated keys. This list contains keys of the various types accepted in descriptor keys expressions.
Definition at line 21 of file descriptor.h.
std::optional< std::string > MockedDescriptorConverter::GetDescriptor | ( | std::string_view | mocked_desc | ) | const |
Get an actual descriptor string from a descriptor string whose keys were mocked.
Definition at line 51 of file descriptor.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 36 of file descriptor.h.
std::optional< uint8_t > MockedDescriptorConverter::IdxFromHex | ( | std::string_view | hex_characters | ) | const |
Parse an id in the keys vectors from a 2-characters hex string.
Definition at line 44 of file descriptor.cpp.
void MockedDescriptorConverter::Init | ( | ) |
When initializing the target, populate the list of keys.
Definition at line 10 of file descriptor.cpp.
|
staticconstexprprivate |
Types are raw (un)compressed pubkeys, raw xonly pubkeys, raw privkeys (WIF), xpubs, xprvs.
Definition at line 24 of file descriptor.h.
|
private |
256 keys of various types.
Definition at line 28 of file descriptor.h.
|
staticconstexprprivate |
How many keys we'll generate in total.
Definition at line 26 of file descriptor.h.