From fa40c0964b751683774b79da4b72d330a9ff87e2 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 4 Jul 2021 14:22:36 +0200 Subject: fuzz: Move ConsumeTxDestination to cpp file Moving the implementation out of the header will reduce compile time --- src/test/fuzz/util.h | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src/test/fuzz/util.h') diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index 023dcdb3e5..60dc9050fe 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -178,36 +178,7 @@ template return CTxMemPoolEntry{MakeTransactionRef(tx), fee, time, entry_height, spends_coinbase, sig_op_cost, {}}; } -[[nodiscard]] inline CTxDestination ConsumeTxDestination(FuzzedDataProvider& fuzzed_data_provider) noexcept -{ - CTxDestination tx_destination; - CallOneOf( - fuzzed_data_provider, - [&] { - tx_destination = CNoDestination{}; - }, - [&] { - tx_destination = PKHash{ConsumeUInt160(fuzzed_data_provider)}; - }, - [&] { - tx_destination = ScriptHash{ConsumeUInt160(fuzzed_data_provider)}; - }, - [&] { - tx_destination = WitnessV0ScriptHash{ConsumeUInt256(fuzzed_data_provider)}; - }, - [&] { - tx_destination = WitnessV0KeyHash{ConsumeUInt160(fuzzed_data_provider)}; - }, - [&] { - WitnessUnknown witness_unknown{}; - witness_unknown.version = fuzzed_data_provider.ConsumeIntegral(); - const std::vector witness_unknown_program_1 = fuzzed_data_provider.ConsumeBytes(40); - witness_unknown.length = witness_unknown_program_1.size(); - std::copy(witness_unknown_program_1.begin(), witness_unknown_program_1.end(), witness_unknown.program); - tx_destination = witness_unknown; - }); - return tx_destination; -} +[[nodiscard]] CTxDestination ConsumeTxDestination(FuzzedDataProvider& fuzzed_data_provider) noexcept; template [[nodiscard]] bool MultiplicationOverflow(const T i, const T j) noexcept -- cgit v1.2.3