aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add test for DER-encoding edge caseSuhas Daftuar2015-02-101-0/+6
| | | | | | The fix to NegateSignatureS caused a test which had been failing in IsValidSignatureEncoding to then fail in IsLowDERSignature. Add new test so the original check remains exercised.
* Fix NegateSignatureS to not duplicate last byte of SSuhas Daftuar2015-02-101-2/+0
| | | | | | | NegateSignatureS is called with a signature without a hashtype, so do not save the last byte and append it after S negation. Updates the two tests which were affected by this bug.
* Merge pull request #5713Wladimir J. van der Laan2015-02-031-0/+73
|\ | | | | | | | | | | | | | | bf6cdeb Increase coverage of DERSIG edge cases (Pieter Wuille) 819bcf9 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille) 5a47811 BIP66 changeover logic (Pieter Wuille) 092e9fe Example unit tests from BIP66 (Pieter Wuille) 80ad135 Change IsDERSignature to BIP66 implementation (Pieter Wuille)
| * Example unit tests from BIP66Pieter Wuille2015-02-011-0/+73
| |
* | Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille2015-02-021-14/+14
| |
* | Use separate SignatureChecker for CMutableTransactionPieter Wuille2015-02-021-14/+14
|/
* Merge pull request #5143Wladimir J. van der Laan2015-01-081-0/+16
|\ | | | | | | | | | | da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille) b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille) ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
| * Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6)Pieter Wuille2014-11-251-0/+16
| | | | | | | | | | Based on an earlier patch by Peter Todd, though the rules here are different (P2SH scripts should not have a CLEANSTACK check before the P2SH evaluation).
* | 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.