9#include <boost/test/unit_test.hpp>
17BOOST_AUTO_TEST_SUITE(chainstate_write_tests)
22 bool m_did_flush{
false};
29 const auto sub{std::make_shared<TestSubscriber>()};
62 m_flushed_at_block = m_tip;
78 chainstate.DisconnectTip(state_dummy,
nullptr);
79 chainstate.DisconnectTip(state_dummy,
nullptr);
91 const auto sub{std::make_shared<TestSubscriber>()};
95 chainstate.ActivateBestChain(state_dummy,
nullptr);
BOOST_FIXTURE_TEST_CASE(chainstate_write_interval, TestingSetup)
static constexpr auto DATABASE_WRITE_INTERVAL_MAX
static constexpr auto DATABASE_WRITE_INTERVAL_MIN
#define Assert(val)
Identity function.
The block chain is a tree shaped structure starting with the genesis block at the root,...
CBlockIndex * pprev
pointer to the index of the predecessor of this block
Implement this to subscribe to events generated in validation and mempool.
virtual void ChainStateFlushed(const kernel::ChainstateRole &role, const CBlockLocator &locator)
Notifies listeners of the new active block chain on-disk.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Notifies listeners when the block chain tip advances.
Testing setup that configures a complete environment.
Information about chainstate that notifications are sent from.
std::unique_ptr< ValidationSignals > validation_signals
Issues calls about blocks and transactions.
std::unique_ptr< ChainstateManager > chainman
std::chrono::seconds GetMockTime()
For testing.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.