diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-03-23 11:04:18 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-03-23 10:58:32 +0100 |
commit | fa2b95f8615453cb1c2829292afed8d2fbd4f045 (patch) | |
tree | 3456304a284bffa4abffabf24257e55867428d5f /src | |
parent | fd2b22bf24d81027d9908d1e8aff498d6cf1a463 (diff) | |
download | bitcoin-fa2b95f8615453cb1c2829292afed8d2fbd4f045.tar.xz |
fuzz: Style fixups
Diffstat (limited to 'src')
-rw-r--r-- | src/test/fuzz/process_message.cpp | 4 | ||||
-rw-r--r-- | src/test/fuzz/process_messages.cpp | 4 | ||||
-rw-r--r-- | src/test/fuzz/tx_pool.cpp | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/test/fuzz/process_message.cpp b/src/test/fuzz/process_message.cpp index 04fc6da9b1..96e1cfa08f 100644 --- a/src/test/fuzz/process_message.cpp +++ b/src/test/fuzz/process_message.cpp @@ -68,8 +68,8 @@ void fuzz_target(FuzzBufferType buffer, const std::string& LIMIT_TO_MESSAGE_TYPE { FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); - ConnmanTestMsg& connman = *(ConnmanTestMsg*)g_setup->m_node.connman.get(); - TestChainState& chainstate = *(TestChainState*)&g_setup->m_node.chainman->ActiveChainstate(); + ConnmanTestMsg& connman = *static_cast<ConnmanTestMsg*>(g_setup->m_node.connman.get()); + TestChainState& chainstate = *static_cast<TestChainState*>(&g_setup->m_node.chainman->ActiveChainstate()); SetMockTime(1610000000); // any time to successfully reset ibd chainstate.ResetIbd(); diff --git a/src/test/fuzz/process_messages.cpp b/src/test/fuzz/process_messages.cpp index ee402dba38..00050391b0 100644 --- a/src/test/fuzz/process_messages.cpp +++ b/src/test/fuzz/process_messages.cpp @@ -35,8 +35,8 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages) { FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); - ConnmanTestMsg& connman = *(ConnmanTestMsg*)g_setup->m_node.connman.get(); - TestChainState& chainstate = *(TestChainState*)&g_setup->m_node.chainman->ActiveChainstate(); + ConnmanTestMsg& connman = *static_cast<ConnmanTestMsg*>(g_setup->m_node.connman.get()); + TestChainState& chainstate = *static_cast<TestChainState*>(&g_setup->m_node.chainman->ActiveChainstate()); SetMockTime(1610000000); // any time to successfully reset ibd chainstate.ResetIbd(); diff --git a/src/test/fuzz/tx_pool.cpp b/src/test/fuzz/tx_pool.cpp index 2a9363a7c3..799de3b9d2 100644 --- a/src/test/fuzz/tx_pool.cpp +++ b/src/test/fuzz/tx_pool.cpp @@ -96,14 +96,13 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool) constexpr CAmount SUPPLY_TOTAL{COINBASE_MATURITY * 50 * COIN}; CTxMemPool tx_pool_{/* estimator */ nullptr, /* check_ratio */ 1}; - MockedTxPool& tx_pool = *(MockedTxPool*)&tx_pool_; + MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_); // Helper to query an amount const CCoinsViewMemPool amount_view{WITH_LOCK(::cs_main, return &chainstate.CoinsTip()), tx_pool}; const auto GetAmount = [&](const COutPoint& outpoint) { Coin c; - amount_view.GetCoin(outpoint, c); - Assert(!c.IsSpent()); + Assert(amount_view.GetCoin(outpoint, c)); return c.out.nValue; }; |