6#include <chainparams.h>
17#include <validation.h>
20#include <boost/test/unit_test.hpp>
32 auto curr_time = GetTime<std::chrono::seconds>();
35 auto block_template{mining->createNewBlock({},
false)};
36 BOOST_REQUIRE(block_template);
37 CBlock block{block_template->getBlock()};
39 block.fChecked =
true;
41 Assert(
node.chainman->ProcessNewBlock(std::make_shared<const CBlock>(block),
true,
true,
nullptr));
42 node.validation_signals->SyncWithValidationInterfaceQueue();
57 uint64_t tip_block_time = tip->GetBlockTime();
58 int tip_block_height = tip->nHeight;
59 peerman->SetBestBlock(tip_block_height, std::chrono::seconds{tip_block_time});
69 SetMockTime(GetTime<std::chrono::seconds>() + std::chrono::seconds{consensus.nPowTargetSpacing * 2});
#define Assert(val)
Identity function.
static std::unique_ptr< PeerManager > make(CConnman &connman, AddrMan &addrman, BanMan *banman, ChainstateManager &chainman, CTxMemPool &pool, node::Warnings &warnings, Options opts)
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(const node::NodeContext &node, bool wait_loaded=true)
Return implementation of Mining interface.
#define BOOST_CHECK(expr)
static void mineBlock(node::NodeContext &node, std::chrono::seconds block_time)
BOOST_AUTO_TEST_CASE(connections_desirable_service_flags)
static constexpr int64_t NODE_NETWORK_LIMITED_ALLOW_CONN_BLOCKS
Window, in blocks, for connecting to NODE_NETWORK_LIMITED peers.
bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params ¶ms)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
ServiceFlags
nServices flags
Identical to TestingSetup, but chain set to regtest.
std::unique_ptr< ValidationSignals > validation_signals
Issues calls about blocks and transactions.
std::unique_ptr< CConnman > connman
std::unique_ptr< CTxMemPool > mempool
std::unique_ptr< AddrMan > addrman
std::unique_ptr< ChainstateManager > chainman
std::unique_ptr< node::Warnings > warnings
Manages all the node warnings.
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.