dcrd/blockchain/fullblocktests
Dave Collins b7676074e3
fullblocktests: Decouple from blockchain.
The blockchain/fullblocktests package currently has a cyclic dependency
on blockchain since the tests directly return the error codes in
blockchain that are expected to be violated while blockchain 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 the blockchain
itself instead of a separate blockchain_test 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-available fullblocktests
package for use both in testing the internal blockchain implementation
as well as integration tests with other implementations.
2022-05-30 11:26:40 -05:00
..
doc.go multi: fix misspell linter warnings 2018-02-18 12:26:52 -06:00
error_test.go fullblocktests: Decouple from blockchain. 2022-05-30 11:26:40 -05:00
error.go fullblocktests: Decouple from blockchain. 2022-05-30 11:26:40 -05:00
generate.go fullblocktests: Decouple from blockchain. 2022-05-30 11:26:40 -05:00
params.go chaincfg: Deprecate Checkpoints and remove entries. 2022-05-19 13:03:30 -05:00
README.md fullblocktests: Update readme module path. 2022-05-30 11:26:40 -05:00

fullblocktests

Build Status ISC License Doc

Package fullblocktests provides a set of full block tests to be used for testing the consensus validation rules. The tests are intended to be flexible enough to allow both unit-style tests directly against the blockchain code as well as integration style tests over the peer-to-peer network. To achieve that goal, each test contains additional information about the expected result, however that information can be ignored when doing comparison tests between two independent versions over the peer-to-peer network.

This package has intentionally been designed so it can be used as a standalone package for any projects needing to test their implementation against a full set of blocks that exercise the consensus validation rules.

Installation and Updating

This package is part of the github.com/decred/dcrd/blockchain/v4 module. Use the standard go tooling for working with modules to incorporate it.

License

Package fullblocktests is licensed under the copyfree ISC License.