5#include <chainparams.h>
10#include <validation.h>
12#include <boost/test/unit_test.hpp>
21 auto curr_time = GetTime<std::chrono::seconds>();
27 Assert(
node.chainman->ProcessNewBlock(std::make_shared<const CBlock>(block),
true,
true,
nullptr));
28 node.validation_signals->SyncWithValidationInterfaceQueue();
43 uint64_t tip_block_time = tip->GetBlockTime();
44 int tip_block_height = tip->nHeight;
45 peerman->SetBestBlock(tip_block_height, std::chrono::seconds{tip_block_time});
55 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)
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()
#define BOOST_CHECK(expr)
static void mineBlock(const 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.