LCOV - code coverage report
Current view: top level - src/test/util - txmempool.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 14 19 73.7 %
Date: 2023-09-26 12:08:55 Functions: 4 6 66.7 %

          Line data    Source code
       1             : // Copyright (c) 2022 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <test/util/txmempool.h>
       6             : 
       7             : #include <chainparams.h>
       8             : #include <node/context.h>
       9             : #include <node/mempool_args.h>
      10             : #include <txmempool.h>
      11             : #include <util/check.h>
      12             : #include <util/time.h>
      13             : #include <util/translation.h>
      14             : 
      15             : using node::NodeContext;
      16             : 
      17        4862 : CTxMemPool::Options MemPoolOptionsForTest(const NodeContext& node)
      18           2 : {
      19       34020 :     CTxMemPool::Options mempool_opts{
      20        4860 :         .estimator = node.fee_estimator.get(),
      21             :         // Default to always checking mempool regardless of
      22             :         // chainparams.DefaultConsistencyChecks for tests
      23             :         .check_ratio = 1,
      24             :     };
      25        4860 :     const auto result{ApplyArgsManOptions(*node.args, ::Params(), mempool_opts)};
      26        4860 :     Assert(result);
      27             :     return mempool_opts;
      28        4860 : }
      29             : 
      30           0 : CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction& tx) const
      31             : {
      32           0 :     return FromTx(MakeTransactionRef(tx));
      33           0 : }
      34             : 
      35           0 : CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransactionRef& tx) const
      36             : {
      37           0 :     return CTxMemPoolEntry{tx, nFee, TicksSinceEpoch<std::chrono::seconds>(time), nHeight, m_sequence, spendsCoinbase, sigOpCost, lp};
      38             : }

Generated by: LCOV version 1.14