8 #include <validation.h>
10 #include <boost/test/unit_test.hpp>
31 BOOST_CHECK(!coin_stats_index.LookUpStats(block_index, coin_stats));
35 BOOST_CHECK(!coin_stats_index.BlockUntilSyncedToCurrentChain());
37 BOOST_REQUIRE(coin_stats_index.Start(
m_node.
chainman->ActiveChainstate()));
41 const auto timeout = GetTime<std::chrono::seconds>() + 120s;
42 while (!coin_stats_index.BlockUntilSyncedToCurrentChain()) {
43 BOOST_REQUIRE(timeout > GetTime<std::chrono::milliseconds>());
53 BOOST_CHECK(coin_stats_index.LookUpStats(genesis_block_index, coin_stats));
56 coin_stats_index.LookUpStats(block_index, coin_stats);
59 std::vector<CMutableTransaction> noTxns;
60 CreateAndProcessBlock(noTxns, script_pub_key);
63 BOOST_CHECK(coin_stats_index.BlockUntilSyncedToCurrentChain());
65 CCoinsStats new_coin_stats{CoinStatsHashType::MUHASH};
71 coin_stats_index.LookUpStats(new_block_index, new_coin_stats);
76 coin_stats_index.Stop();