![]() |
Bitcoin Core 31.0.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. | |
| std::optional< uint8_t > | IdxFromHex (std::string_view hex_characters) const |
| Parse an id in the keys vectors from a 2-characters hex string. | |
| std::optional< std::string > | GetDescriptor (std::string_view mocked_desc) const |
| Get an actual descriptor string from a descriptor string whose keys were mocked. | |
Private Attributes | |
| std::array< std::string, TOTAL_KEYS_GENERATED > | keys_str |
| 256 keys of various types. | |
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. | |
| static constexpr size_t | TOTAL_KEYS_GENERATED {std::numeric_limits<uint8_t>::max() + 1} |
| How many keys we'll generate in total. | |
Converts a mocked descriptor string to a valid one.
Every key in a mocked descriptor 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 key expressions.
Definition at line 23 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 59 of file descriptor.cpp.
Definition at line 38 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 52 of file descriptor.cpp.
| void MockedDescriptorConverter::Init | ( | ) |
When initializing the target, populate the list of keys.
Definition at line 17 of file descriptor.cpp.
Types are raw (un)compressed pubkeys, raw xonly pubkeys, raw privkeys (WIF), xpubs, xprvs.
Definition at line 26 of file descriptor.h.
|
private |
256 keys of various types.
Definition at line 30 of file descriptor.h.
|
staticconstexprprivate |
How many keys we'll generate in total.
Definition at line 28 of file descriptor.h.