Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show All 39 Lines | bool TestSequenceLocks(const CTransaction &tx, int flags) | ||||
return CheckSequenceLocks(*m_node.mempool, tx, flags); | return CheckSequenceLocks(*m_node.mempool, tx, flags); | ||||
} | } | ||||
BlockAssembler AssemblerForTest(const CChainParams ¶ms); | BlockAssembler AssemblerForTest(const CChainParams ¶ms); | ||||
}; | }; | ||||
} // namespace miner_tests | } // namespace miner_tests | ||||
BOOST_FIXTURE_TEST_SUITE(miner_tests, MinerTestingSetup) | BOOST_FIXTURE_TEST_SUITE(miner_tests, MinerTestingSetup) | ||||
// BOOST_CHECK_EXCEPTION predicates to check the specific validation error | |||||
class HasReason { | |||||
public: | |||||
explicit HasReason(const std::string &reason) : m_reason(reason) {} | |||||
bool operator()(const std::runtime_error &e) const { | |||||
return std::string(e.what()).find(m_reason) != std::string::npos; | |||||
}; | |||||
private: | |||||
const std::string m_reason; | |||||
}; | |||||
static CFeeRate blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB); | static CFeeRate blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB); | ||||
BlockAssembler MinerTestingSetup::AssemblerForTest(const CChainParams ¶ms) { | BlockAssembler MinerTestingSetup::AssemblerForTest(const CChainParams ¶ms) { | ||||
BlockAssembler::Options options; | BlockAssembler::Options options; | ||||
options.blockMinFeeRate = blockMinFeeRate; | options.blockMinFeeRate = blockMinFeeRate; | ||||
return BlockAssembler(params, *m_node.mempool, options); | return BlockAssembler(params, *m_node.mempool, options); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 684 Lines • Show Last 20 Lines |