Commit graph

313 commits

Author SHA1 Message Date
Nell Hardcastle 8808f237aa Support auxillary proof of work.
Rebased from 1.7.1 into 1.7.2, moved AuxPoW checks from AcceptBlock()
into AcceptBlockHeader()
2014-08-01 16:42:50 +02:00
Wladimir J. van der Laan ab25bec2ea Replace non-threadsafe gmtime and setlocale
Make DateTimeStrFormat use boost::posix_time.

Also re-enable the util_DateTimeStrFormat tests, as they are no
longer platform specific.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 3e8ac6a
2014-07-09 17:12:18 +02:00
Pieter Wuille 20111387a7 Move base58.h implementation code to base58.cpp
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: f6b7c64
2014-07-09 16:36:24 +02:00
Peter Todd d3fd2ce6b0 Fix script test handling of empty scripts
Previously an empty script would evaluate to OP_0
2014-06-29 16:15:37 +02:00
Wladimir J. van der Laan 82820e56be Add tests for BoostAsioToCNetAddr 2014-06-29 15:38:45 +02:00
Wladimir J. van der Laan 2d76e1f9df Remove unused function WildcardMatch
No longer necessary after implementing netmask-based matching.
Also remove a longer-unused function `skipspaces`.
2014-06-29 15:38:44 +02:00
Wladimir J. van der Laan 407a7605dc net: Add CSubNet class for subnet matching 2014-06-29 15:38:44 +02:00
Wladimir J. van der Laan 6f4a1156dd util: add parseint32 function with strict error reporting
None of the current integer parsing functions in util
check whether the result is valid and fits in the range
of the type. This is required for less sloppy error reporting.
2014-06-29 15:38:43 +02:00
Pieter Wuille b108e2aae2 Add multiplication and division to uint160/uint256 2014-06-29 15:38:42 +02:00
Pieter Wuille eee99edaca Exception instead of assigning 0 in case of wrong vector length 2014-06-29 15:38:42 +02:00
Wladimir J. van der Laan f5bfbdb649 Fix transaction tests
Conflict between low-s (6fd7ef2) and test updates in d3a33fc.
2014-06-29 15:38:41 +02:00
Pieter Wuille 4644e65561 Also switch the (unused) verification code to low-s instead of even-s.
a81cd968 introduced a malleability breaker for signatures
(using an even value for S). In e0e14e43 this was changed to
the lower of two potential values, rather than the even one.
Only the signing code was changed though, the (for now unused)
verification code wasn't adapted.
2014-06-29 15:38:41 +02:00
Peter Todd 50e3d3f3e1 Test CHECKMULTISIG with m == 0 and n == 0 2014-06-29 15:38:40 +02:00
Peter Todd ec389a30e5 Add rejection of non-null CHECKMULTISIG dummy values
This is a source of transaction mutability as the dummy value was
previously not checked and could be modified to something other than the
usual OP_0 value.
2014-06-29 15:38:38 +02:00
Peter Todd 49d701e7aa Let tx (in)valid tests use any SCRIPT_VERIFY flag
Previously only P2SH could be set.
2014-06-29 15:38:33 +02:00
super3 889bd0fed5 Removed LevelDB changes
Syntax Highlighting
2014-06-29 15:38:29 +02:00
Jannis Froese 23a761453d
remove unit tests for old fee mode 2014-06-09 00:51:20 +02:00
Jannis Froese 19653cea9d Revert "remove unit tests for new fee mode"
This reverts commit 78ed897c4a.
2014-06-09 00:46:52 +02:00
Wladimir J. van der Laan e4da390764 Add required locks in tests
Unit tests with DEBUG_LOCKORDER were running into assertions.
2014-05-29 20:06:49 +02:00
Cory Fields 4697e9462c script: Add test for CScriptNum
Because this class replaces some usages of CBigNum, tests have been added to
verify that they function the same way. The only difference in their usage is
the handling of out-of-range numbers.

While operands are constrained to [-0x7FFFFFFF,0x7FFFFFFF], the results may
overflow. The overflowing result is technically unbounded, but in practice
it can be no bigger than the result of an operation on two operands. This
implementation limits them to the size of an int64.

CBigNum was unaware of this constraint, so it allowed for unbounded results,
which were then checked before use. CScriptNum asserts if an arithmetic
operation will overflow an int64_t, since scripts are not able to reach those
numbers anyway. Additionally, CScriptNum will throw an exception when
constructed from a vector containing more than 4 bytes This mimics the previous
CastToBigNum behavior.
2014-05-29 20:05:07 +02:00
Cory Fields 7036baf33e script: add additional script tests 2014-05-29 20:04:45 +02:00
langerhans 464394c832 Supply working pre-generated sighash test vectors. 2014-05-26 21:51:41 +02:00
Manuel Araoz fa51037024 Add code generating data/sighash.json test data 2014-05-26 19:41:56 +02:00
Manuel Araoz b43c35599c Add sighash tests from data file 2014-05-26 19:41:48 +02:00
Pieter Wuille 30f5429536 Per-peer block download tracking and stalled download detection.
Keep track of which block is being requested (and to be requested) from
each peer, and limit the number of blocks in-flight per peer. In addition,
detect stalled downloads, and disconnect if they persist for too long.

This means blocks are never requested twice, and should eliminate duplicate
downloads during synchronization.
2014-05-25 18:56:47 +02:00
Wladimir J. van der Laan c88b4903c1 Fix test build after d138598
Building the tests was giving some vague error message about a doubly-defined
symbol.

The solution is to define ShutdownRequested in test_bitcoin.cpp as well
so that init.cpp does not get pulled in.
2014-05-25 18:03:15 +02:00
Luke Dashjr a4797f9bdb Update moved and dead links 2014-05-25 18:02:48 +02:00
Wladimir J. van der Laan a66204eed2 Add licenses for tests and test data
- Add license headers to source files (years based on commit dates)
  in `src/test` as well as `qa`
- Add `README.md` to `src/test/data` specifying MIT license

Fixes #3848
2014-05-18 22:22:49 +01:00
Philip Kaufmann 3e0de4da6b minor style cleanups
Conflicts:

	src/main.cpp
2014-05-18 16:50:24 +01:00
Jannis Froese 78ed897c4a remove unit tests for new fee mode 2014-05-04 17:40:32 +02:00
Jannis Froese d2d6a97340 add unit tests for GetMinFee 2014-05-04 01:31:43 +02:00
Ross Nicoll 657a287ddb Merge pull request #490 from leofidus/1.7-subsidy-limit-test
fixed subsidy limit unittest
2014-04-24 23:17:57 +01:00
Jannis Froese 32ff658b53 fixed subsidy limit test 2014-04-24 23:34:18 +02:00
langerhans bcce1e6b42 Fix doubled alerts in alert tests causing them to fail 2014-04-24 21:59:40 +02:00
Patrick Lodder 7a5ea77afd Added scrypt_tests from 1.6 2014-04-24 20:09:08 +04:00
Patrick Lodder cf026beea4 Fix bloom tests, p2sh part.
Fixing only those parts that do not test for p2pubkey scripts
because we have hardly any, if any transactions other than
p2sh. Regression testing will still work for p2pubkey, but
those are performed on bitcoin blocks rather than ours.

Fixed units:
- bloom_create_insert_key
- bloom_match
- merkle_block_1
- merkle_block_3 with an actual doge block
2014-04-19 21:36:10 +04:00
langerhans 77b52b742b Merge pull request #452 from leofidus/1.7-alerttests
add SignAndSave to Alert_tests
2014-04-17 20:24:17 +02:00
langerhans 68ae64ae86 Updated signed alert test data to reflect Dogecoin keys 2014-04-17 20:23:41 +02:00
langerhans ccc7c41859 Merge pull request #468 from patricklodder/1.7-dev-miner-test
Fixed miner test
2014-04-15 20:21:07 +02:00
Patrick Lodder beedf4a363 DUST fix for transaction tests
DOGE does not have a DUST limit, so the only valid test
for us is that a value of 1 should not be marked as dust
2014-04-15 17:11:21 +04:00
Patrick Lodder 54f557865b Fixed miner test
- Changed test pubkey script to the same one used in genesis
- Changed the simulated block interval to 60 seconds
- Replaced extranonce/nonce combinations to be valid on top of our genesis block.
- Added check to make sure all created blocks are included in the active chain
2014-04-15 14:36:00 +04:00
langerhans d079f108bf Merge pull request #453 from rnicoll/1.7-dev-rpc-tests
RPC signing test fixes
2014-04-14 19:03:39 +02:00
Jannis Froese e791535df3 add SignAndSave to Alert_tests 2014-04-13 13:06:00 +02:00
leofidus 9a482a4d62 Merge pull request #451 from rnicoll/1.7-dev-tx-fee
Correct unit tests for wallet
2014-04-13 12:17:49 +02:00
Ross Nicoll f52fb58f15
Rebuild RPC signing test with Dogecoin multisig address and private keys. 2014-04-13 10:50:19 +01:00
Ross Nicoll 71532b730d
Reworked comment around the code for identifying transactions to spend, to separate explanation of condition, and result.
Corrected comment references to "cent", with "coin" in wallet tests, to match changes to units.
2014-04-13 00:07:06 +01:00
Ross Nicoll eda7f83cd0
Shifted unit in wallet tests from CENT to COIN as a base, to avoid problems with dust avoidance code. 2014-04-12 23:08:48 +01:00
Ross Nicoll ad9434f9f4
Scaled up units when testing dust-avoidance in wallet. 2014-04-12 23:01:49 +01:00
Ross Nicoll b08bfd12b4
Modified expected values in wallet tests to take into account the numerically higher transaction costs of DOGE. 2014-04-12 22:50:35 +01:00
Patrick Lodder b2de543c81 change valid base58 key test data to doge network 2014-04-13 01:18:11 +04:00