MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TestChain100Setup

Method TestChain100Setup

src/test/util/setup_common.cpp:413–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413TestChain100Setup::TestChain100Setup(
414 const ChainType chain_type,
415 TestOpts opts)
416 : TestingSetup{ChainType::REGTEST, opts}
417{
418 constexpr std::array<unsigned char, 32> vchKey = {
419 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}};
420 coinbaseKey.Set(vchKey.begin(), vchKey.end(), true);
421
422 // Generate a 100-block chain:
423 this->mineBlocks(COINBASE_MATURITY);
424
425 {
426 LOCK(::cs_main);
427 assert(
428 m_node.chainman->ActiveChain().Tip()->GetBlockHash().ToString() ==
429 "0ee6e270d6594249e548110619f7bd690695beb219b915da4a2e84e2b61ed60f");
430 }
431}
432
433void TestChain100Setup::mineBlocks(int num_blocks)
434{

Callers

nothing calls this directly

Calls 7

mineBlocksMethod · 0.95
SetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
ToStringMethod · 0.45
GetBlockHashMethod · 0.45
TipMethod · 0.45

Tested by

no test coverage detected