13#include <boost/test/unit_test.hpp>
35 BOOST_REQUIRE(mining);
37 BlockAssembler::Options options;
38 std::unique_ptr<BlockTemplate> block_template;
44 block_template = mining->createNewBlock(options);
45 BOOST_REQUIRE(block_template);
48 BOOST_REQUIRE_EQUAL(block_template->getBlockHeader().nTime, genesis_time + 3 * 60);
53 auto should_be_nullptr = block_template->waitNext(wait_options);
54 BOOST_REQUIRE(should_be_nullptr ==
nullptr);
61 should_be_nullptr = block_template->waitNext(wait_options);
62 BOOST_REQUIRE(should_be_nullptr ==
nullptr);
71 block_template = block_template->waitNext(wait_options);
72 BOOST_REQUIRE(block_template);
Block template interface.
Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block te...
Generate a new block, without valid proof-of-work.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
std::unique_ptr< Mining > MakeMining(node::NodeContext &node)
Return implementation of Mining interface.
Identical to TestingSetup, but chain set to testnet4.
MillisecondsDouble timeout
How long to wait before returning nullptr instead of a new template.
std::unique_ptr< ChainstateManager > chainman
std::unique_ptr< Mining > MakeMining()
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
BOOST_AUTO_TEST_CASE(MiningInterface)
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble