MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/tests/checkblock_tests.cpp:45–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45BOOST_AUTO_TEST_CASE(May15)
46{
47 // Putting a 1MB binary file in the git repository is not a great
48 // idea, so this test is only run if you manually download
49 // test/data/Mar12Fork.dat from
50 // http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/Mar12Fork.dat/download
51 unsigned int tMay15 = 1368576000;
52 SetMockTime(tMay15); // Test as if it was right at May 15
53 CAccountDBCache view(*pAccountViewTip, true);
54 CContractDBCache scriptDBCache(*pScriptDBTip, true);
55 CBlock forkingBlock;
56 if (read_block("Mar12Fork.dat", forkingBlock))
57 {
58 CValidationState state;
59
60 // After May 15'th, big blocks are OK:
61 forkingBlock.SetTime(tMay15); // Invalidates PoW
62 BOOST_CHECK(CheckBlock(forkingBlock, state, view, scriptDBCache, false, false));
63 }
64
65 SetMockTime(0);
66}
67
68BOOST_AUTO_TEST_SUITE_END()
69#endif //TODO

Callers

nothing calls this directly

Calls 4

SetMockTimeFunction · 0.85
read_blockFunction · 0.85
CheckBlockFunction · 0.85
SetTimeMethod · 0.80

Tested by

no test coverage detected