diff options
| author | Sjors Provoost <[email protected]> | 2017-11-09 12:02:46 +0100 |
|---|---|---|
| committer | Sjors Provoost <[email protected]> | 2017-11-09 12:02:46 +0100 |
| commit | 12781db0585ed7ddcfd7134bc2a0cbabb4de21e3 (patch) | |
| tree | 2f890bdb735840b440c0ee9c8bd61ce1af3f3573 /src/httpserver.cpp | |
| parent | Merge #11182: [tests] Add P2P interface to TestNode (diff) | |
| download | discoin-12781db0585ed7ddcfd7134bc2a0cbabb4de21e3.tar.xz discoin-12781db0585ed7ddcfd7134bc2a0cbabb4de21e3.zip | |
[Tests] check specific validation error in miner tests
BOOST_CHECK_THROW merely checks that some std::runtime_error is
thrown, but not which one.
One example of how this could lead to a test passing when a developer
introduces a consensus bug: the test for the sigops limit assumes
that CreateNewBlock fails with bad-blk-sigops. However it can
also fail with bad-txns-vout-negative, e.g. if a naive developer lowers
BLOCKSUBSIDY to 1*COIN in the test.
BOOST_CHECK_EXCEPTION allows an additional predicate function. This
commit uses this for all exceptions that are checked for in
miner_tets.cpp:
* bad-blk-sigops
* bad-cb-multiple
* bad-txns-inputs-missingorspent
* block-validation-failed
An instance of the CheckRejectInvalid class (for a given validation string)
is passed to BOOST_CHECK_EXCEPTION.
Diffstat (limited to 'src/httpserver.cpp')
0 files changed, 0 insertions, 0 deletions