Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/coins_view.cpp
Show First 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | if (fuzzed_data_provider.ConsumeBool()) { | ||||
0, std::numeric_limits<int>::max()), | 0, std::numeric_limits<int>::max()), | ||||
tx_fee_out); | tx_fee_out); | ||||
assert(MoneyRange(tx_fee_out)); | assert(MoneyRange(tx_fee_out)); | ||||
} catch (const std::runtime_error &) { | } catch (const std::runtime_error &) { | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
case 3: { | case 3: { | ||||
CCoinsStats stats; | CCoinsStats stats{CoinStatsHashType::HASH_SERIALIZED}; | ||||
bool expected_code_path = false; | bool expected_code_path = false; | ||||
try { | try { | ||||
(void)GetUTXOStats( | (void)GetUTXOStats( | ||||
&coins_view_cache, | &coins_view_cache, | ||||
WITH_LOCK(::cs_main, | WITH_LOCK(::cs_main, | ||||
return std::ref(g_chainman.m_blockman)), | return std::ref(g_chainman.m_blockman)), | ||||
stats, CoinStatsHashType::HASH_SERIALIZED); | stats); | ||||
} catch (const std::logic_error &) { | } catch (const std::logic_error &) { | ||||
expected_code_path = true; | expected_code_path = true; | ||||
} | } | ||||
assert(expected_code_path); | assert(expected_code_path); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |