5 #include <boost/test/unit_test.hpp>
13 BOOST_FIXTURE_TEST_SUITE(validationinterface_tests,
TestingSetup)
35 for (
int i = 0; i < 250000; i++) {
36 auto sub = std::make_shared<TestSubscriberNoop>();
52 TestInterface(std::function<
void()> on_call =
nullptr, std::function<
void()> on_destroy =
nullptr)
79 bool destroyed =
false;
89 [&] { destroyed =
true; }));
void BlockChecked(const CBlock &, const BlockValidationState &)
Implement this to subscribe to events generated in validation.
TestInterface(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
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK(expr)
static RPCHelpMan generate()
void BlockChecked(const CBlock &, const BlockValidationState &) override
Notifies listeners of a block validation result.
Testing setup that configures a complete environment.
CMainSignals & GetMainSignals()
void UnregisterSharedValidationInterface(std::shared_ptr< CValidationInterface > callbacks)
Unregister subscriber.
void UnregisterAllValidationInterfaces()
Unregister all subscribers.
void RegisterSharedValidationInterface(std::shared_ptr< CValidationInterface > callbacks)
Register subscriber.
BOOST_AUTO_TEST_CASE(unregister_validation_interface_race)