Add unit tests for next difficulty calculations

Split GetNextWorkRequired() into two functions to allow the difficulty calculations to
be tested without requiring a full blockchain.
Add unit tests to cover basic difficulty calculation, plus each of the min/max actual
time, and maximum difficulty target conditions.
This commit is contained in:
Ross Nicoll
2015-02-21 12:57:44 +00:00
parent aaba10f275
commit 34e5015cd2
4 changed files with 74 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ BITCOIN_TESTS =\
test/multisig_tests.cpp \
test/netbase_tests.cpp \
test/pmt_tests.cpp \
test/pow_tests.cpp \
test/rpc_tests.cpp \
test/sanity_tests.cpp \
test/script_P2SH_tests.cpp \