Bitcoin Core 22.99.0
P2P Digital Currency
descriptor_parse.cpp
Go to the documentation of this file.
1// Copyright (c) 2009-2020 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <chainparams.h>
6#include <pubkey.h>
7#include <script/descriptor.h>
8#include <test/fuzz/fuzz.h>
9
11{
12 static const ECCVerifyHandle verify_handle;
13 ECC_Start();
15}
16
18{
19 const std::string descriptor(buffer.begin(), buffer.end());
20 FlatSigningProvider signing_provider;
21 std::string error;
22 for (const bool require_checksum : {true, false}) {
23 const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
24 if (desc) {
25 (void)desc->ToString();
26 (void)desc->IsRange();
27 (void)desc->IsSolvable();
28 }
29 }
30}
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
static const std::string MAIN
Chain name strings.
Users of this module must hold an ECCVerifyHandle.
Definition: pubkey.h:316
std::unique_ptr< Descriptor > Parse(const std::string &descriptor, FlatSigningProvider &out, std::string &error, bool require_checksum)
Parse a descriptor string.
FUZZ_TARGET_INIT(descriptor_parse, initialize_descriptor_parse)
void initialize_descriptor_parse()
void ECC_Start()
Initialize the elliptic curve support.
Definition: key.cpp:370
bool error(const char *fmt, const Args &... args)
Definition: system.h:49