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 }
Parse
std::unique_ptr< Descriptor > Parse(const std::string &descriptor, FlatSigningProvider &out, std::string &error, bool require_checksum)
Parse a descriptor string.
Definition: descriptor.cpp:1393
FUZZ_TARGET_INIT
FUZZ_TARGET_INIT(descriptor_parse, initialize_descriptor_parse)
Definition: descriptor_parse.cpp:17
pubkey.h
chainparams.h
SelectParams
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
Definition: chainparams.cpp:555
initialize_descriptor_parse
void initialize_descriptor_parse()
Definition: descriptor_parse.cpp:10
CBaseChainParams::MAIN
static const std::string MAIN
Chain name strings.
Definition: chainparamsbase.h:22
ECC_Start
void ECC_Start()
Initialize the elliptic curve support.
Definition: key.cpp:370
ECCVerifyHandle
Users of this module must hold an ECCVerifyHandle.
Definition: pubkey.h:315
fuzz.h
error
bool error(const char *fmt, const Args &... args)
Definition: system.h:49
FlatSigningProvider
Definition: signingprovider.h:73
descriptor.h