MCPcopy Create free account
hub / github.com/ElementsProject/elements / TestChain100Setup

Method TestChain100Setup

src/test/util/setup_common.cpp:265–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265TestChain100Setup::TestChain100Setup(const std::vector<const char*>& extra_args)
266 : TestingSetup{CBaseChainParams::REGTEST, "", extra_args} // ELEMENTS: added empty fedpegscript here
267{
268 SetMockTime(1598887952);
269 constexpr std::array<unsigned char, 32> vchKey = {
270 {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}};
271 coinbaseKey.Set(vchKey.begin(), vchKey.end(), true);
272
273 // Generate a 100-block chain:
274 this->mineBlocks(COINBASE_MATURITY);
275
276 {
277 LOCK(::cs_main);
278 assert(
279 m_node.chainman->ActiveChain().Tip()->GetBlockHash().ToString() ==
280 "571d80a9967ae599cec0448b0b0ba1cfb606f584d8069bd7166b86854ba7a191");
281 }
282}
283
284void TestChain100Setup::mineBlocks(int num_blocks)
285{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected