|
23 | 23 |
|
24 | 24 | #include <boost/test/unit_test.hpp> |
25 | 25 |
|
26 | | -BOOST_FIXTURE_TEST_SUITE(miner_tests, TestingSetup) |
| 26 | +namespace miner_tests { |
| 27 | +struct MinerTestingSetup : public TestingSetup { |
| 28 | + void TestPackageSelection(const CChainParams& chainparams, const CScript& scriptPubKey, const std::vector<CTransactionRef>& txFirst) EXCLUSIVE_LOCKS_REQUIRED(::cs_main, m_node.mempool->cs); |
| 29 | + bool TestSequenceLocks(const CTransaction& tx, int flags) EXCLUSIVE_LOCKS_REQUIRED(::cs_main, m_node.mempool->cs) |
| 30 | + { |
| 31 | + return CheckSequenceLocks(*m_node.mempool, tx, flags); |
| 32 | + } |
| 33 | +}; |
| 34 | +} // namespace miner_tests |
| 35 | + |
| 36 | +BOOST_FIXTURE_TEST_SUITE(miner_tests, MinerTestingSetup) |
27 | 37 |
|
28 | 38 | // BOOST_CHECK_EXCEPTION predicates to check the specific validation error |
29 | 39 | class HasReason { |
@@ -89,16 +99,10 @@ static CBlockIndex CreateBlockIndex(int nHeight) EXCLUSIVE_LOCKS_REQUIRED(cs_mai |
89 | 99 | return index; |
90 | 100 | } |
91 | 101 |
|
92 | | -static bool TestSequenceLocks(const CTransaction &tx, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main) |
93 | | -{ |
94 | | - LOCK(::mempool.cs); |
95 | | - return CheckSequenceLocks(::mempool, tx, flags); |
96 | | -} |
97 | | - |
98 | 102 | // Test suite for ancestor feerate transaction selection. |
99 | 103 | // Implemented as an additional function, rather than a separate test case, |
100 | 104 | // to allow reusing the blockchain created in CreateNewBlock_validity. |
101 | | -static void TestPackageSelection(const CChainParams& chainparams, const CScript& scriptPubKey, const std::vector<CTransactionRef>& txFirst) EXCLUSIVE_LOCKS_REQUIRED(cs_main, ::mempool.cs) |
| 105 | +void MinerTestingSetup::TestPackageSelection(const CChainParams& chainparams, const CScript& scriptPubKey, const std::vector<CTransactionRef>& txFirst) |
102 | 106 | { |
103 | 107 | // Test the ancestor feerate transaction selection. |
104 | 108 | TestMemPoolEntryHelper entry; |
|
0 commit comments