aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #5513Wladimir J. van der Laan2015-01-061-7/+0
|\ \ | | | | | | | | | | | | | | | 856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields) 9b1ab86 namespace: drop boost::assign altogether here (Cory Fields) a324199 namespace: remove boost namespace pollution (Cory Fields)
| * | namespace: drop most boost namespaces and a few header cleanupsCory Fields2015-01-021-7/+0
| | | | | | | | | | | | A few boost::asio were left around because they're very wordy otherwise.
* | | clarify obscure uses of EvalScript()Pavel Vasin2014-12-301-4/+4
|/ / | | | | | | The 3rd argument of EvalScript() is the unsigned int flags, not a bool.
* | Use deterministically generated script testsPieter Wuille2014-12-011-22/+12
| | | | | | | | | | | | | | Now that signing is deterministic, we can require exact correspondence between the automatically generated tests and the ones read from JSON. Do this, and update the tests to those deterministic versions. Note that some flag changes weren't correctly applied before.
* | Merge pull request #5227Wladimir J. van der Laan2014-12-011-1/+2
|\ \ | |/ |/| | | | | | | | | | | | | 4cdaa95 Resize after succesful result (Pieter Wuille) 9d8604f Header define style cleanups (Pieter Wuille) a53fd41 Deterministic signing (Pieter Wuille) 3060e36 Add the RFC6979 PRNG (Pieter Wuille) a8f5087 Add HMAC-SHA256 (Pieter Wuille) 36fa4a7 Split up crypto/sha2 (Pieter Wuille)
| * Deterministic signingPieter Wuille2014-11-201-1/+2
| |
* | Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille2014-11-201-6/+15
|/ | | | | | | This turns STRICTENC turn into a softforking-safe change (even though it is not intended as a consensus rule), and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool.
* build: add quick consensus lib testsCory Fields2014-11-191-1/+12
| | | | They should be hooked up in other places as well, but this is a start.
* Do not use EC code in global constructorsPieter Wuille2014-11-181-1/+2
|
* script: check ScriptError values in script testsCory Fields2014-11-141-20/+46
|
* Do signature-s negation inside the testsPieter Wuille2014-11-101-1/+46
| | | | To avoid the need for libsecp256k1 to expose such functionality.
* Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille2014-10-251-5/+5
| | | | | Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
* Add SCRIPT_VERIFY_SIGPUSHONLY (BIP62 rule 2)Pieter Wuille2014-10-251-2/+21
|
* script: add ToByteVector() for converting anything with begin/endCory Fields2014-10-171-44/+44
| | | | This should move to a util header once their dependencies are cleaned up.
* script: move CScriptID to standard.h and add a ctor for creating them from ↵Cory Fields2014-10-171-2/+2
| | | | | | | | | | | | | | | | CScripts This allows for a reversal of the current behavior. This: CScript foo; CScriptID bar(foo.GetID()); Becomes: CScript foo; CScriptID bar(foo); This way, CScript is no longer dependent on CScriptID or Hash();
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-081-12/+60
| | | | | | | | * Delete canonical_tests.cpp, and move the tests to script_tests.cpp. * Split off SCRIPT_VERIFY_DERSIG from SCRIPT_VERIFY_STRICTENC (the BIP62 part of it). * Change signature STRICTENC/DERSIG semantics to fail the script entirely rather than the CHECKSIG result (softfork safety, and BIP62 requirement). * Add many autogenerated tests for several odd cases. * Mention specific BIP62 rules in the script verification flags.
* Prettify JSON tests and minimize diffsPieter Wuille2014-10-071-14/+29
|
* Merge pull request #4890Wladimir J. van der Laan2014-10-061-18/+18
|\ | | | | | | | | | | e790c37 Replace SCRIPT_VERIFY_NOCACHE by flag directly to checker (Pieter Wuille) 5c1e798 Make signature cache optional (Pieter Wuille) c7829ea Abstract out SignatureChecker (Pieter Wuille)
| * Replace SCRIPT_VERIFY_NOCACHE by flag directly to checkerPieter Wuille2014-10-021-17/+17
| |
| * Abstract out SignatureCheckerPieter Wuille2014-10-021-1/+1
| |
* | DRY: Avoid repetitions in script_testjtimon2014-10-021-30/+7
|/
* Fix vector out of bounds in script testsPieter Wuille2014-09-291-8/+8
|
* Add automatic script test generation, and actual checksig testsPieter Wuille2014-09-261-8/+317
|
* Use actually valid transactions for script testsPieter Wuille2014-09-221-5/+44
|
* Merge pull request #4555Wladimir J. van der Laan2014-09-171-19/+19
|\ | | | | | | | | | | | | 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)
| * Don't pass nHashType to EvalScript nor CheckSigjtimon2014-09-121-4/+4
| |
| * Don't pass nHashType to VerifyScriptjtimon2014-09-121-15/+15
| |
* | Move CTxDestination from script/script to script/standardPieter Wuille2014-09-161-3/+3
|/
* Make script_{valid,invalid}.json validation flags configurablePieter Wuille2014-09-081-4/+8
|
* Separate script/signjtimon2014-09-081-1/+1
|
* Move CScript class and dependencies to script/scriptjtimon2014-09-081-0/+1
|
* Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes)jtimon2014-09-081-3/+1
|
* Test IsPushOnly() with invalid pushPeter Todd2014-08-241-0/+11
|
* Declare SignatureHash() in script.hjtimon2014-08-011-2/+1
|
* Move ParseScript() helper, becoming accessible outside src/test/Jeff Garzik2014-07-291-70/+1
|
* Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-6/+6
| | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* Merge pull request #3860 from petertodd/test-checkmulti-n-m-zeroGavin Andresen2014-05-091-1/+5
|\ | | | | Test CHECKMULTISIG with m == 0 and/or n == 0
| * Fix script test handling of empty scriptsPeter Todd2014-03-121-1/+5
| | | | | | | | Previously an empty script would evaluate to OP_0
* | Add licenses for tests and test dataWladimir J. van der Laan2014-03-181-0/+4
|/ | | | | | | | - 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
* Add HasCanonicalPushes(), and use it in IsStandardTxPieter Wuille2014-02-111-0/+18
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-9/+16
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Revert "Switch to using raw_utf8"Jeff Garzik2013-10-221-2/+2
| | | | This reverts commit 2ecb7555a9df1e843fd25f588819e4ca1d94b266.
* Merge pull request #2740 from constantined/constantinedGavin Andresen2013-10-221-2/+2
|\ | | | | UTF-8 support for JSON-RPC
| * Switch to using raw_utf8constantined2013-07-231-2/+2
| |
* | Inline signature serializerPieter Wuille2013-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of building a full copy of a CTransaction being signed, and then modifying bits and pieces until its fits the form necessary for computing the signature hash, use a wrapper serializer that only serializes the necessary bits on-the-fly. This makes it easier to see which data is actually being hash, reduces load on the heap, and also marginally improves performances (around 3-4us/sigcheck here). The performance improvements are much larger for large transactions, though. The old implementation of SignatureHash is moved to a unit tests, to test whether the old and new algorithm result in the same value for randomly-constructed transactions.
* | included-tests: generate binary data from test files for inclusion into test ↵Cory Fields2013-09-161-25/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | binaries This change moves test data into the binaries rather than reading them from the disk at runtime. Advantages: - Tests become distributable - Cross-compile friendly. Build on one machine and execute in an arbitrary location on another. - Easier testing for backports. Users can verify that tests pass without having to track down corresponding test data. - More trustworthy test results and easier quality assurance as tests make fewer assumptions about their environment. - Tests could theoretically run at client/daemon startup and exit on failure. Disadvantages: - Required 'hexdump' build-dependency. This is a standard bsd tool that should be usable everywhere. It is likely already installed on all build-machines. - Tests can no longer be fudged after build by altering test-data.
* | Bugfix: Since test_bitcoin is being built and run inside src/test/, try ↵Luke Dashjr2013-09-101-1/+1
| | | | | | | | using relative directories from that point
* | Document and test OP_RESERVED weirdnessPeter Todd2013-08-251-2/+6
|/ | | | | | Seems it was forgotten about when IsPushOnly() and the unittests were written. A particular oddity is that OP_RESERVED doesn't count towards the >201 opcode limit unlike every other named opcode.
* CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille2013-05-301-3/+5
|
* Introduce script verification flagsPieter Wuille2012-11-151-17/+17
| | | | | | | | These flags select features to be enabled/disabled during script evaluation/checking, instead of several booleans passed along. Currently these flags are defined: * SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation * SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.