Skip to content

Commit fa2b95f

Browse files
author
MarcoFalke
committed
fuzz: Style fixups
1 parent fd2b22b commit fa2b95f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/test/fuzz/process_message.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ void fuzz_target(FuzzBufferType buffer, const std::string& LIMIT_TO_MESSAGE_TYPE
6868
{
6969
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
7070

71-
ConnmanTestMsg& connman = *(ConnmanTestMsg*)g_setup->m_node.connman.get();
72-
TestChainState& chainstate = *(TestChainState*)&g_setup->m_node.chainman->ActiveChainstate();
71+
ConnmanTestMsg& connman = *static_cast<ConnmanTestMsg*>(g_setup->m_node.connman.get());
72+
TestChainState& chainstate = *static_cast<TestChainState*>(&g_setup->m_node.chainman->ActiveChainstate());
7373
SetMockTime(1610000000); // any time to successfully reset ibd
7474
chainstate.ResetIbd();
7575

src/test/fuzz/process_messages.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages)
3535
{
3636
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
3737

38-
ConnmanTestMsg& connman = *(ConnmanTestMsg*)g_setup->m_node.connman.get();
39-
TestChainState& chainstate = *(TestChainState*)&g_setup->m_node.chainman->ActiveChainstate();
38+
ConnmanTestMsg& connman = *static_cast<ConnmanTestMsg*>(g_setup->m_node.connman.get());
39+
TestChainState& chainstate = *static_cast<TestChainState*>(&g_setup->m_node.chainman->ActiveChainstate());
4040
SetMockTime(1610000000); // any time to successfully reset ibd
4141
chainstate.ResetIbd();
4242

src/test/fuzz/tx_pool.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
9696
constexpr CAmount SUPPLY_TOTAL{COINBASE_MATURITY * 50 * COIN};
9797

9898
CTxMemPool tx_pool_{/* estimator */ nullptr, /* check_ratio */ 1};
99-
MockedTxPool& tx_pool = *(MockedTxPool*)&tx_pool_;
99+
MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_);
100100

101101
// Helper to query an amount
102102
const CCoinsViewMemPool amount_view{WITH_LOCK(::cs_main, return &chainstate.CoinsTip()), tx_pool};
103103
const auto GetAmount = [&](const COutPoint& outpoint) {
104104
Coin c;
105-
amount_view.GetCoin(outpoint, c);
106-
Assert(!c.IsSpent());
105+
Assert(amount_view.GetCoin(outpoint, c));
107106
return c.out.nValue;
108107
};
109108

0 commit comments

Comments
 (0)