diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-07-04 21:18:59 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-07-04 21:29:56 +0200 |
commit | fa42800a51919bb50a1000ac4f58847e6a7092a3 (patch) | |
tree | 308bc11019eb09256d466409ac4ffa0da048d276 /src/test/fuzz | |
parent | fab99865c0e62468a1b55d7e467398cc2343121b (diff) | |
download | bitcoin-fa42800a51919bb50a1000ac4f58847e6a7092a3.tar.xz |
fuzz: Simplify CTxDestination fuzzing in the script target
The WitnessUnknown operators == and < are already called indirectly by
the corresponding CTxDestination operators.
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/script.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index b87bcf2ef5..1d5f37d109 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -184,25 +184,12 @@ FUZZ_TARGET_INIT(script, initialize_script) } { - WitnessUnknown witness_unknown_1{}; - witness_unknown_1.version = fuzzed_data_provider.ConsumeIntegral<uint32_t>(); - const std::vector<uint8_t> witness_unknown_program_1 = fuzzed_data_provider.ConsumeBytes<uint8_t>(40); - witness_unknown_1.length = witness_unknown_program_1.size(); - std::copy(witness_unknown_program_1.begin(), witness_unknown_program_1.end(), witness_unknown_1.program); - - WitnessUnknown witness_unknown_2{}; - witness_unknown_2.version = fuzzed_data_provider.ConsumeIntegral<uint32_t>(); - const std::vector<uint8_t> witness_unknown_program_2 = fuzzed_data_provider.ConsumeBytes<uint8_t>(40); - witness_unknown_2.length = witness_unknown_program_2.size(); - std::copy(witness_unknown_program_2.begin(), witness_unknown_program_2.end(), witness_unknown_2.program); - - (void)(witness_unknown_1 == witness_unknown_2); - (void)(witness_unknown_1 < witness_unknown_2); - } - - { - const CTxDestination tx_destination_1 = ConsumeTxDestination(fuzzed_data_provider); + const CTxDestination tx_destination_1{ + fuzzed_data_provider.ConsumeBool() ? + DecodeDestination(fuzzed_data_provider.ConsumeRandomLengthString()) : + ConsumeTxDestination(fuzzed_data_provider)}; const CTxDestination tx_destination_2 = ConsumeTxDestination(fuzzed_data_provider); + (void)(tx_destination_1 == tx_destination_2); (void)(tx_destination_1 < tx_destination_2); } |