11#include <validation.h>
13#include <boost/test/unit_test.hpp>
18BOOST_AUTO_TEST_SUITE(baseindex_tests)
27 auto sync_index = [&](
bool do_flush,
int expected_sync_height,
int expected_commit_height) {
29 BOOST_REQUIRE(index.Init());
33 m_node.
chain->context()->validation_signals->SyncWithValidationInterfaceQueue();
38 BOOST_REQUIRE(index.Init());
47 sync_index(
false, 100, 0);
52 sync_index(
true, 100, 100);
59 sync_index(
false, 101, 100);
BOOST_FIXTURE_TEST_CASE(baseindex_no_commit_ahead_of_flush, TestChain100Setup)
#define Assert(val)
Identity function.
Serialized script, used inside transaction inputs and outputs.
Chainstate stores and provides an API to update our local knowledge of the current best chain.
void ForceFlushStateToDisk(bool wipe_cache=true)
Flush all changes to disk.
CoinStatsIndex maintains statistics on the UTXO set.
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(headers.FindFirst("key"), "value")
std::unique_ptr< Chain > MakeChain(node::NodeContext &node)
Return implementation of Chain interface.
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
std::unique_ptr< ChainstateManager > chainman
std::unique_ptr< interfaces::Chain > chain