Commit graph

388 commits

Author SHA1 Message Date
Wladimir J. van der Laan
b50e5fe099
Merge pull request #4968
219372f script: Fix reference into empty vector run time exception (ENikS)
2014-09-25 11:48:33 +02:00
ENikS
219372f1dd
script: Fix reference into empty vector run time exception
Edit by laanwj: `begin_ptr(sourcedata) + sourcedata.size()` -> `end_ptr(sourcedata)`
2014-09-25 11:46:52 +02:00
ENikS
c8063b5712 Fixing out of bounds asses error 2014-09-23 11:17:43 -04:00
Pieter Wuille
c8589bf99e Add actual signature tests 2014-09-22 19:26:17 +02:00
Pieter Wuille
76ec867796 Use actually valid transactions for script tests 2014-09-22 19:26:17 +02:00
Wladimir J. van der Laan
33a27716fc
test: Fix DoS tests after c74332c
Fix data structure mismatch ... The mind boggles that they were still passing at all.
2014-09-20 09:55:14 +02:00
Wladimir J. van der Laan
438c7e4cd2
Merge pull request #4555
6dcfda2 Don't pass nHashType to EvalScript nor CheckSig (jtimon)
2b23a87 Don't pass nHashType to VerifyScript (jtimon)
ce3649fb Remove CScriptCheck::nHashType (was always 0) (jtimon)
358562b Remove unused function main:VerifySignature (jtimon)
2014-09-17 13:44:22 +02:00
Pieter Wuille
0be990ba34 Move CTxDestination from script/script to script/standard 2014-09-16 19:14:32 +02:00
Luke Dashjr
a65e320747 bitcoin-util-test: Test bitcoin-tx with null scriptPubKey 2014-09-14 06:28:22 +00:00
jtimon
6dcfda2dc4 Don't pass nHashType to EvalScript nor CheckSig 2014-09-12 20:04:31 +02:00
jtimon
2b23a87599 Don't pass nHashType to VerifyScript 2014-09-12 20:04:31 +02:00
jtimon
ce3649fb61 Remove CScriptCheck::nHashType (was always 0) 2014-09-12 20:03:03 +02:00
jtimon
358562b651 Remove unused function main:VerifySignature 2014-09-12 20:03:03 +02:00
Pieter Wuille
b9307d2f55
Merge pull request #4876
6022b5d Make script_{valid,invalid}.json validation flags configurable (Pieter Wuille)
2014-09-12 18:33:02 +02:00
Gavin Andresen
c74332c678
Stricter handling of orphan transactions
Prevent denial-of-service attacks by banning
peers that send us invalid orphan transactions
and only storing orphan transactions given to
us by a peer while the peer is connected.
2014-09-10 14:09:40 -04:00
jtimon
c1e433b717 Rename scriptutils.o to wallet_ismine.o 2014-09-10 12:48:35 +02:00
jtimon
0d2fa14a34 Move scriptutils.o to wallet 2014-09-10 12:42:56 +02:00
Pieter Wuille
6022b5dc6b Make script_{valid,invalid}.json validation flags configurable 2014-09-08 22:38:26 +02:00
jtimon
e088d65acb Separate script/sign 2014-09-08 20:21:35 +02:00
jtimon
da03e6ed7c Separate script/interpreter 2014-09-08 20:21:33 +02:00
jtimon
cbd22a50c4 Move CScript class and dependencies to script/script 2014-09-08 20:19:31 +02:00
jtimon
86dbeea2cd Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes) 2014-09-08 20:19:31 +02:00
jtimon
87d9819d4d fix comments ExtractAddress() -> ExtractDestination() 2014-08-28 01:54:45 +02:00
Pieter Wuille
d1062e32fa
Merge pull request #4377
654871d replace ComputeMinWork with CheckMinWork (jtimon)
b343c1a Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) (jtimon)
c2c02f3 Move UpdateTime to pow (jtimon)
2014-08-27 22:39:28 +02:00
Pieter Wuille
3da58b216b
Merge pull request #4748
ad49c25 Split up util.cpp/h (Wladimir J. van der Laan)
f841aa2 Move `COIN` and `CENT` to core.h (Wladimir J. van der Laan)
6e5fd00 Move `*Version()` functions to version.h/cpp (Wladimir J. van der Laan)
b4aa769 Move `S_I*` constants and `MSG_NOSIGNAL` to compat.h (Wladimir J. van der Laan)
af8297c Move functions in wallet.h to implementation file (Wladimir J. van der Laan)
651480c move functions in main and net to implementation files (Wladimir J. van der Laan)
610a8c0 Move SetThreadPriority implementation to util.cpp instead of the header (Wladimir J. van der Laan)
f780e65 Remove unused function `ByteReverse` from util.h (Wladimir J. van der Laan)
121d6ad Remove unused `alignup` function from util.h (Wladimir J. van der Laan)
d1e26d4 Move CMedianFilter to timedata.cpp (Wladimir J. van der Laan)
2014-08-26 16:57:05 +02:00
Wladimir J. van der Laan
ad49c256c3 Split up util.cpp/h
Split up util.cpp/h into:

- string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach)
- money utilities (parsesmoney, formatmoney)
- time utilities (gettime*, sleep, format date):
- and the rest (logging, argument parsing, config file parsing)

The latter is basically the environment and OS handling,
and is stripped of all utility functions, so we may want to
rename it to something else than util.cpp/h for clarity (Matt suggested
osinterface).

Breaks dependency of sha256.cpp on all the things pulled in by util.
2014-08-26 13:25:22 +02:00
Wladimir J. van der Laan
d1e26d4e71 Move CMedianFilter to timedata.cpp
Now that we no longer use the median filter to keep track of
the number of blocks of peers, that's the only place it is used.
2014-08-26 13:25:20 +02:00
Peter Todd
aa41ac216e
Test IsPushOnly() with invalid push 2014-08-24 21:16:51 -04:00
Pieter Wuille
5cd00bc8cb
Merge pull request #4618
eb0b56b Simplify serialize.h's exception handling (Pieter Wuille)
2014-08-24 02:06:09 +02:00
jtimon
654871d436 replace ComputeMinWork with CheckMinWork 2014-08-23 13:21:51 +02:00
Jeff Garzik
fac54dcb71
Merge pull request #4733 2014-08-22 10:35:39 -04:00
Jeff Garzik
9c31174992
Merge pull request #4744 2014-08-20 23:16:21 -04:00
Jeff Garzik
7f836c66bd rpc_tests: use BOOST_CHECK_EQUAL
Upon failure, BOOST_CHECK_EQUAL provides additional diagnostic information,
displaying that data that failed to match.
2014-08-20 22:43:36 -04:00
Jeff Garzik
dc271fc025 UniValue tests: use more BOOST_CHECK() 2014-08-20 01:09:21 -04:00
Jeff Garzik
e85267be63 UniValue: add unit tests 2014-08-20 00:28:46 -04:00
Jeff Garzik
df4d61e681 Add bitcoin-tx tests
Testing: delin, delout, locktime, and basic createrawtransaction-like
functionality.
2014-08-19 23:15:58 -04:00
Jeff Garzik
fb14452c6c bitcoin-tx: Accept input via stdin. Add input handling to tests. 2014-08-19 10:29:10 -04:00
Jeff Garzik
d789386371 Add "it works" test for bitcoin-tx 2014-08-19 10:28:58 -04:00
Pieter Wuille
eb0b56b190 Simplify serialize.h's exception handling
Remove the 'state' and 'exceptmask' from serialize.h's stream implementations,
as well as related methods.

As exceptmask always included 'failbit', and setstate was always called with
bits = failbit, all it did was immediately raise an exception. Get rid of
those variables, and replace the setstate with direct exception throwing
(which also removes some dead code).

As a result, good() is never reached after a failure (there are only 2
calls, one of which is in tests), and can just be replaced by !eof().

fail(), clear(n) and exceptions() are just never called. Delete them.
2014-08-09 01:43:23 +02:00
jtimon
f5745fa52a Declare SignatureHash() in script.h 2014-08-01 17:45:09 +02:00
Wladimir J. van der Laan
b7bba43a14
Merge pull request #4560
d2d9dc0 script tests: add tests for CHECKMULTISIG limits (Otto Allmendinger)
89101c6 script test: test case for 5-byte bools (Otto Allmendinger)
4cac5db script tests: value with trailing 0x00 is true (Otto Allmendinger)
833ff16 script tests: values that overflow to 0 are true (Otto Allmendinger)
0072d98 script tests: BOOLAND, BOOLOR decode to integer (Otto Allmendinger)
ed02282 additional test for OP_SIZE in script_valid.json (Otto Allmendinger)
2014-07-31 09:42:00 +02:00
Wladimir J. van der Laan
2870014f3a
Merge pull request #4568
9c34731 CBloomFilter::clear() method (Tom Harding)
2014-07-31 09:25:20 +02:00
Jeff Garzik
b2aeaa7939 Move ParseScript() helper, becoming accessible outside src/test/ 2014-07-29 11:13:27 -04:00
Tom Harding
9c347313f7 CBloomFilter::clear() method 2014-07-21 11:50:07 -07:00
Wladimir J. van der Laan
8f3f94a470 Revert "CBloomFilter::clear() method"
This reverts commit 8fbf03995d.
2014-07-21 07:46:34 +02:00
Otto Allmendinger
d2d9dc063f script tests: add tests for CHECKMULTISIG limits 2014-07-18 17:55:06 +02:00
Otto Allmendinger
89101c6e78 script test: test case for 5-byte bools 2014-07-18 15:41:45 +02:00
Otto Allmendinger
4cac5dbf83 script tests: value with trailing 0x00 is true 2014-07-18 12:55:46 +02:00
Otto Allmendinger
833ff161bc script tests: values that overflow to 0 are true 2014-07-18 11:02:28 +02:00
Otto Allmendinger
0072d98849 script tests: BOOLAND, BOOLOR decode to integer
unlike other boolean checks, arguments >5 bytes invalidate the script
2014-07-18 10:53:09 +02:00