Question on creating test cases for block.CheckBlock()



Summary:

The author is working on a BIP that requires modification of the block acceptance rules, and has two ways of testing it- mining blocks on the testnet or creating test cases for Bitcoin Core. The author wants to create test cases for block.CheckBlock() by verifying 100 dynamically generated blocks. However, they are unsure about the state of the blockchain when a test case is executed, as well as which network it is configured for (regtest, testnet3, or mainnet) and what blocks are in the blockchain. The author found that checkblock_tests.cpp is the only test case for CheckBlock(), but it assumes that the mainnet is configured. Therefore, the author needs to use regtest so they can create blocks of difficulty 1.


Updated on: 2023-06-09T01:27:33.561893+00:00