diff options
author | Carl Dong <contact@carldong.me> | 2022-04-29 13:30:27 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-05-20 16:33:24 -0400 |
commit | 0848db9c35d9eae4d68cbdbef68c337656f3c906 (patch) | |
tree | 1c34a3440f2750020d886e788f6d7a3c58d3e42e /src | |
parent | 52b1939993771d0a8a718ca1667241872de8241a (diff) | |
download | bitcoin-0848db9c35d9eae4d68cbdbef68c337656f3c906.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/coins_view.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
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 <consensus/tx_verify.h> #include <consensus/validation.h> #include <key.h> -#include <node/coinstats.h> #include <policy/policy.h> #include <primitives/transaction.h> #include <pubkey.h> @@ -26,10 +25,6 @@ #include <string> #include <vector> -using node::CCoinsStats; -using node::CoinStatsHashType; -using node::GetUTXOStats; - namespace { const TestingSetup* g_setup; const Coin EMPTY_COIN{}; @@ -270,16 +265,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); }); } |