This PR moves the following block validation rule tests to
fullblocktests.
- `ErrBlockOneOutputs`
- Create a premine block with one premine output removed.
- Create a premine block with a bad spend script.
- Create a premine block with an incorrect pay to amount.
- `ErrVotesMismatch`
- Create block with a header that commits to more votes than the block
actually contains.
- `ErrIncongruentVotebit`
- Attempt to add block with incorrect votebits set.
- 4x Voters, 2x Nay 2x Yea, but block header says Yea
- 3x Voters, 2x Nay 1x Yea, but block header says Yea
- 3x Voters, 1x Nay 2x Yea, but block header says Nay
- `ErrSStxCommitment`
- Attempt to add block with a bad ticket purchase commitment.
- `ErrSSGenPayeeOuts`
- Attempt to add a block with a bad vote payee output.
- Attempt to add a block with an incorrect vote payee output amount.
- `ErrBadCoinbaseFraudProof`
- Create block with an invalid coinbase transaction.
- `ErrFraudBlockIndex`
- Create block with an invalid transaction block height.
- `ErrFraudAmountIn`
- Create block with an invalid transaction amount.
- `ErrExpiredTx`
- Create block with an expired transaction.
- `ErrBadBlockHeight`
- Create block with an invalid block height.
- `ErrPoolSize`
- Create block with an invalid ticket pool size.
- `ErrInvalidFinalState`
- Create block with an invalid final state.
- `ErrScriptMalformed`
- Create block with a malformed spend script.
|
||
|---|---|---|
| .. | ||
| doc.go | ||
| generate.go | ||
| params.go | ||
| README.md | ||
fullblocktests
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
$ go get -u github.com/decred/dcrd/blockchain/fullblocktests
License
Package fullblocktests is licensed under the copyfree ISC License.