|
2 | 2 | // Distributed under the MIT software license, see the accompanying
|
3 | 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
4 | 4 |
|
| 5 | +#include <addresstype.h> |
5 | 6 | #include <chainparams.h>
|
6 |
| -#include <validation.h> |
| 7 | +#include <coins.h> |
| 8 | +#include <key.h> |
| 9 | +#include <primitives/transaction.h> |
| 10 | +#include <psbt.h> |
| 11 | +#include <script/descriptor.h> |
| 12 | +#include <script/interpreter.h> |
| 13 | +#include <script/script.h> |
| 14 | +#include <script/signingprovider.h> |
| 15 | +#include <sync.h> |
7 | 16 | #include <test/fuzz/FuzzedDataProvider.h>
|
8 | 17 | #include <test/fuzz/fuzz.h>
|
9 | 18 | #include <test/fuzz/util.h>
|
10 | 19 | #include <test/fuzz/util/descriptor.h>
|
11 | 20 | #include <test/util/setup_common.h>
|
| 21 | +#include <util/check.h> |
| 22 | +#include <util/translation.h> |
| 23 | +#include <validation.h> |
12 | 24 | #include <wallet/scriptpubkeyman.h>
|
13 |
| -#include <wallet/wallet.h> |
14 | 25 | #include <wallet/test/util.h>
|
| 26 | +#include <wallet/types.h> |
| 27 | +#include <wallet/wallet.h> |
| 28 | +#include <wallet/walletutil.h> |
| 29 | + |
| 30 | +#include <map> |
| 31 | +#include <memory> |
| 32 | +#include <optional> |
| 33 | +#include <string> |
| 34 | +#include <utility> |
| 35 | +#include <variant> |
15 | 36 |
|
16 | 37 | namespace wallet {
|
17 | 38 | namespace {
|
@@ -99,7 +120,9 @@ FUZZ_TARGET(scriptpubkeyman, .init = initialize_spkm)
|
99 | 120 | bool extract_dest{ExtractDestination(spk, dest)};
|
100 | 121 | if (extract_dest) {
|
101 | 122 | const std::string msg{fuzzed_data_provider.ConsumeRandomLengthString()};
|
102 |
| - PKHash pk_hash{fuzzed_data_provider.ConsumeBool() ? PKHash{ConsumeUInt160(fuzzed_data_provider)} : *std::get_if<PKHash>(&dest)}; |
| 123 | + PKHash pk_hash{std::get_if<PKHash>(&dest) && fuzzed_data_provider.ConsumeBool() ? |
| 124 | + *std::get_if<PKHash>(&dest) : |
| 125 | + PKHash{ConsumeUInt160(fuzzed_data_provider)}}; |
103 | 126 | std::string str_sig;
|
104 | 127 | (void)spk_manager->SignMessage(msg, pk_hash, str_sig);
|
105 | 128 | }
|
|
0 commit comments