Bitcoin Core  25.99.0
P2P Digital Currency
descriptor_parse.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009-2021 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 #include <util/chaintype.h>
10 
12 {
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 }
ECC_Start()
Definition: key.cpp:391
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
static UniValue Parse(std::string_view raw)
Parse string to UniValue or throw runtime_error if string contains invalid JSON.
Definition: client.cpp:301
FUZZ_TARGET_INIT(descriptor_parse, initialize_descriptor_parse)
void initialize_descriptor_parse()
bool error(const char *fmt, const Args &... args)
Definition: logging.h:261