fullblocktests: Decouple from blockchain. #2951
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
blockchain/fullblocktests
package currently has a cyclic dependency onblockchain
since the tests directly return the error codes inblockchain
that are expected to be violated whileblockchain
itself needs to import the package in order to run the tests.This resolves that cyclic dependency by defining all of the errors the
fullblocktests
produce in the package itself and then converting them to the associated error in blockchain when running the tests and checking for the expected error.It also moves the code that runs the
fullblocktests
into theblockchain
package itself instead of a separateblockchain_test
package to match all other tests now that there is no longer a cyclic dependency that forced it to be be separated.While duplication of the errors in question is a little less convenient, this approach ensures the
blockchain
package can be made internal in the future while still providing the publicly-availablefullblocktests
package for use both in testing the internalblockchain
implementation as well as integration tests with other implementations.Finally, this also has a few other commits with some minor cleanup.