From 0848db9c35d9eae4d68cbdbef68c337656f3c906 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Fri, 29 Apr 2022 13:30:27 -0400 Subject: fuzz: Remove useless GetUTXOStats fuzz case In the GetUTXOStats fuzz case, GetUTXOStats is always called with a CCoinsViewCache. Which is guaranteed to throw a std::logic_error when its ::Cursor() method is called on the first line of GetUTXOStats. In the fuzz case, we basically catch this logic error and declare victory if we caught it. There is no point to fuzzing this deterministic logic. Confirmed with IWYU that the node/coinstats.h #include is no longer necessary. --- src/test/fuzz/coins_view.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/test/fuzz') diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp index 360dc00307..6c96702f1e 100644 --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -26,10 +25,6 @@ #include #include -using node::CCoinsStats; -using node::CoinStatsHashType; -using node::GetUTXOStats; - namespace { const TestingSetup* g_setup; const Coin EMPTY_COIN{}; @@ -269,16 +264,6 @@ FUZZ_TARGET_INIT(coins_view, initialize_coins_view) } (void)GetTransactionSigOpCost(transaction, coins_view_cache, flags); }, - [&] { - CCoinsStats stats{CoinStatsHashType::HASH_SERIALIZED}; - bool expected_code_path = false; - try { - (void)GetUTXOStats(&coins_view_cache, g_setup->m_node.chainman->m_blockman, stats); - } catch (const std::logic_error&) { - expected_code_path = true; - } - assert(expected_code_path); - }, [&] { (void)IsWitnessStandard(CTransaction{random_mutable_transaction}, coins_view_cache); }); -- cgit v1.2.3