aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* change blockchain -> block chain (spelling)Philip Kaufmann2012-10-211-2/+2
| | | | | - Wiki says "block chain" is correct ;) - remove some unneeded spaces I found in the source, while fixing the spelling
* Check for canonical public keys and signaturesPieter Wuille2012-09-211-20/+20
| | | | Only enabled inside tests for now.
* Implement raw transaction RPC callsGavin Andresen2012-07-051-0/+113
| | | | | | Implement listunspent / getrawtransaction / createrawtransaction / signrawtransaction, to support creation and signing-on-multiple-device multisignature transactions.
* Lots more Script unit test cases.Gavin Andresen2012-05-241-1/+4
|
* More CScript unit tests.Gavin Andresen2012-05-241-5/+7
|
* Define TEST_DATA_DIR so unit tests can be run from any current working directoryGavin Andresen2012-04-261-2/+6
|
* Data-drive script evaluation unit tests.Gavin Andresen2012-04-211-0/+150
|