The blockchain package contains a test function named TestBlockValidationRules which tests various consensus rules in regards to block validation. This is a holdover from initial development and uses a pregenerated blockchain that is modified on the fly in order to hit the conditions. This is not ideal because, as the code changes, the pregenerated chain no longer represents a completely valid chain where only the specific condition being tested is invalid and thus ends up relying on the specific order of the checks in the code in order to pass the tests.
The fullblocktests package was written precisely to avoid this problem since it programmatically generates a fully valid chain on the fly and only munges the blocks to cause a very specific condition to be tested while ensuring the block is otherwise entirely valid. Any of the rules which are tested by TestBlockValidationRules that are not already covered by the existing fullblocktests should be ported over to the fullblocktests framework instead.
In order to ease the transition and review process, I would highly recommend this be done as a series of commits where each commit is dedicated to adding the relevant test to the fullblocktests package and simultaneously removing it from TestBlockValidationRules function. This will help ensure no tests are accidentally missed.
The
blockchainpackage contains a test function namedTestBlockValidationRuleswhich tests various consensus rules in regards to block validation. This is a holdover from initial development and uses a pregenerated blockchain that is modified on the fly in order to hit the conditions. This is not ideal because, as the code changes, the pregenerated chain no longer represents a completely valid chain where only the specific condition being tested is invalid and thus ends up relying on the specific order of the checks in the code in order to pass the tests.The
fullblocktestspackage was written precisely to avoid this problem since it programmatically generates a fully valid chain on the fly and only munges the blocks to cause a very specific condition to be tested while ensuring the block is otherwise entirely valid. Any of the rules which are tested byTestBlockValidationRulesthat are not already covered by the existingfullblocktestsshould be ported over to thefullblocktestsframework instead.In order to ease the transition and review process, I would highly recommend this be done as a series of commits where each commit is dedicated to adding the relevant test to the
fullblocktestspackage and simultaneously removing it fromTestBlockValidationRulesfunction. This will help ensure no tests are accidentally missed.