![]() |
Bitcoin Core
24.1.0
P2P Digital Currency
|
Classes | |
| struct | MaxInt |
| Class whose objects represent the maximum of a list of integers. More... | |
| struct | NoDupCheck |
| struct | Ops |
| struct | StackSize |
Functions | |
| Type | SanitizeType (Type x) |
| A helper sanitizer/checker for the output of CalcType. More... | |
| Type | ComputeType (Fragment fragment, Type x, Type y, Type z, const std::vector< Type > &sub_types, uint32_t k, size_t data_size, size_t n_subs, size_t n_keys) |
| Helper function for Node::CalcType. More... | |
| size_t | ComputeScriptLen (Fragment fragment, Type sub0typ, size_t subsize, uint32_t k, size_t n_subs, size_t n_keys) |
| Helper function for Node::CalcScriptLen. More... | |
| std::optional< std::vector< Opcode > > | DecomposeScript (const CScript &script) |
| Decode a script into opcode/push pairs. More... | |
| std::optional< int64_t > | ParseScriptNumber (const Opcode &in) |
| Determine whether the passed pair (created by DecomposeScript) is pushing a number. More... | |
| int | FindNextChar (Span< const char > sp, const char m) |
| template<typename Key , typename Ctx > | |
| std::optional< std::pair< Key, int > > | ParseKeyEnd (Span< const char > in, const Ctx &ctx) |
| Parse a key string ending at the end of the fragment's text representation. More... | |
| template<typename Ctx > | |
| std::optional< std::pair< std::vector< unsigned char >, int > > | ParseHexStrEnd (Span< const char > in, const size_t expected_size, const Ctx &ctx) |
| Parse a hex string ending at the end of the fragment's text representation. More... | |
| template<typename Key > | |
| void | BuildBack (Fragment nt, std::vector< NodeRef< Key >> &constructed, const bool reverse=false) |
BuildBack pops the last two elements off constructed and wraps them in the specified Fragment. More... | |
| template<typename Key , typename Ctx > | |
| NodeRef< Key > | Parse (Span< const char > in, const Ctx &ctx) |
| Parse a miniscript from its textual descriptor form. More... | |
| template<typename Key , typename Ctx , typename I > | |
| NodeRef< Key > | DecodeScript (I &in, I last, const Ctx &ctx) |
| Parse a miniscript from a bitcoin script. More... | |
|
strong |
Definition at line 1399 of file miniscript.h.
|
strong |
Definition at line 929 of file miniscript.h.
| void miniscript::internal::BuildBack | ( | Fragment | nt, |
| std::vector< NodeRef< Key >> & | constructed, | ||
| const bool | reverse = false |
||
| ) |
BuildBack pops the last two elements off constructed and wraps them in the specified Fragment.
Definition at line 1012 of file miniscript.h.
| size_t miniscript::internal::ComputeScriptLen | ( | Fragment | fragment, |
| Type | sub0typ, | ||
| size_t | subsize, | ||
| uint32_t | k, | ||
| size_t | n_subs, | ||
| size_t | n_keys | ||
| ) |
Helper function for Node::CalcScriptLen.
Definition at line 250 of file miniscript.cpp.
| Type miniscript::internal::ComputeType | ( | Fragment | fragment, |
| Type | x, | ||
| Type | y, | ||
| Type | z, | ||
| const std::vector< Type > & | sub_types, | ||
| uint32_t | k, | ||
| size_t | data_size, | ||
| size_t | n_subs, | ||
| size_t | n_keys | ||
| ) |
Helper function for Node::CalcType.
Definition at line 36 of file miniscript.cpp.
|
inline |
Parse a miniscript from a bitcoin script.
In the following wrappers, we only need to push SINGLE_BKV_EXPR rather than BKV_EXPR, because and_v commutes with these wrappers. For example, c:and_v(X,Y) produces the same script as and_v(X,c:Y).
In and_b and or_b nodes, we only look for SINGLE_BKV_EXPR, because or_b(and_v(X,Y),Z) has script [X] [Y] [Z] OP_BOOLOR, the same as and_v(X,or_b(Y,Z)). In this example, the former of these is invalid as miniscript, while the latter is valid. So we leave the and_v "outside" while decoding.
Definition at line 1469 of file miniscript.h.
| std::optional< std::vector< Opcode > > miniscript::internal::DecomposeScript | ( | const CScript & | script | ) |
Decode a script into opcode/push pairs.
Construct a vector with one element per opcode in the script, in reverse order. Each element is a pair consisting of the opcode, as well as the data pushed by the opcode (including OP_n), if any. OP_CHECKSIGVERIFY, OP_CHECKMULTISIGVERIFY, and OP_EQUALVERIFY are decomposed into OP_CHECKSIG, OP_CHECKMULTISIG, OP_EQUAL respectively, plus OP_VERIFY.
Definition at line 282 of file miniscript.cpp.
| int miniscript::internal::FindNextChar | ( | Span< const char > | sp, |
| const char | m | ||
| ) |
Definition at line 331 of file miniscript.cpp.
|
inline |
Parse a miniscript from its textual descriptor form.
This does not check whether the script is valid, let alone sane. The caller is expected to use the IsValidTopLevel() and IsSaneTopLevel() to check for these properties on the node.
Definition at line 1029 of file miniscript.h.
| std::optional<std::pair<std::vector<unsigned char>, int> > miniscript::internal::ParseHexStrEnd | ( | Span< const char > | in, |
| const size_t | expected_size, | ||
| const Ctx & | ctx | ||
| ) |
Parse a hex string ending at the end of the fragment's text representation.
Definition at line 998 of file miniscript.h.
| std::optional<std::pair<Key, int> > miniscript::internal::ParseKeyEnd | ( | Span< const char > | in, |
| const Ctx & | ctx | ||
| ) |
Parse a key string ending at the end of the fragment's text representation.
Definition at line 987 of file miniscript.h.
| std::optional< int64_t > miniscript::internal::ParseScriptNumber | ( | const Opcode & | in | ) |
Determine whether the passed pair (created by DecomposeScript) is pushing a number.
Definition at line 318 of file miniscript.cpp.
A helper sanitizer/checker for the output of CalcType.
Definition at line 16 of file miniscript.cpp.
1.8.14