5#include <boost/test/unit_test.hpp>
38 for (
int i = 0; i < 250000; i++) {
39 auto sub = std::make_shared<TestSubscriberNoop>();
83 bool destroyed =
false;
84 auto shared{std::make_shared<TestInterface>(
88 m_node.validation_signals->UnregisterAllValidationInterfaces();
89 BOOST_CHECK(!destroyed);
91 m_node.validation_signals->UnregisterAllValidationInterfaces();
92 BOOST_CHECK(!destroyed);
94 [&] { destroyed = true; })};
Implement this to subscribe to events generated in validation and mempool.
ValidationSignals & m_signals
TestInterface(ValidationSignals &signals, std::function< void()> on_call=nullptr, std::function< void()> on_destroy=nullptr)
std::function< void()> m_on_call
void BlockChecked(const CBlock &block, const BlockValidationState &state) override
Notifies listeners of a block validation result.
std::function< void()> m_on_destroy
void BlockChecked(const CBlock &, const BlockValidationState &)
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK(expr)
static RPCHelpMan generate()
Testing setup that performs all steps up until right before ChainstateManager gets initialized.
void BlockChecked(const CBlock &, const BlockValidationState &) override
Notifies listeners of a block validation result.
std::unique_ptr< ValidationSignals > validation_signals
Issues calls about blocks and transactions.
BOOST_AUTO_TEST_CASE(unregister_validation_interface_race)