aboutsummaryrefslogtreecommitdiff
path: root/src/test/data/script_invalid.json
Commit message (Collapse)AuthorAgeFilesLines
* Merge script_valid and script_invalid testsPieter Wuille2016-04-051-877/+0
|
* Make script_error a mandatory 4th field for script_testsPieter Wuille2016-04-051-553/+553
|
* Fix some misconstructed testsPieter Wuille2016-04-051-8/+8
| | | | | | | | They claimed to be testing P2SH scripts with non-push scriptSigs, but 1) they were not enabling P2SH 2) they have push-only scriptSigs Fix this, and add a few more related cases.
* test: Script_error checking in script_invalid testsWladimir J. van der Laan2016-02-111-491/+554
| | | | | | | | | | Check the returned script_error. Add expected script_error for generated as well as custom tests. The specific error is not part of consensus, however it could avoid unclear reporting issues such as #6862 in the future. Fixes #7513.
* test: Move non-generated script_invalid test to the correct placeWladimir J. van der Laan2016-02-111-6/+6
| | | | | This test was introduced in 9fadf1c874f938f87395495776dbae896551873d, but accidentally added in the autogenerated area.
* Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY.mb300sd2015-12-151-3/+3
|
* Merge pull request #6075Wladimir J. van der Laan2015-04-291-0/+18
|\ | | | | | | 9fadf1c Add additional script edge condition tests. (Dave Collins)
| * Add additional script edge condition tests.Dave Collins2015-04-281-0/+18
| | | | | | | | | | | | | | | | | | | | This commit adds several tests to the script_invalid.json data which exercise some edge conditions that are not currently being tested. These are mainly being added to cover several cases a branch coverage analysis of btcd showed are not already being covered, but given more tests of edge conditions are always a good thing, I'm contributing them upstream.
* | Correct the PUSHDATA4 minimal encoding test.Dave Collins2015-04-271-1/+1
|/ | | | | | | | | | | | | | The test which is intended to prove that the script engine is properly rejecting non-minimally encoded PUSHDATA4 data is using the wrong opcode and value. The test is using 0x4f, which is OP_1NEGATE instead of the desired 0x4e, which is OP_PUSHDATA4. Further, the push of data is intended to be 256 bytes, but the value the test is using is 0x00100000 (4096), instead of the desired 0x00010000 (256). This commit fixes both issues. This was found while examining the branch coverage in btcd against only these tests to help find missing branch coverage.
* Switch test case signing to RFC6979 extra entropyPieter Wuille2015-03-271-23/+23
| | | | | Instead of manually tweaking the deterministic nonce post-generation, pass the test case number in as extra entropy to RFC6979.
* 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-1/+1
| | | | | | | 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.
* Increase coverage of DERSIG edge casesPieter Wuille2015-02-011-0/+10
|
* Example unit tests from BIP66Pieter Wuille2015-02-011-0/+96
|
* Make empty byte arrays pass CheckSignatureEncoding()Peter Todd2015-01-091-1/+1
| | | | | | | | | | | | Makes it possible to compactly provide a delibrately invalid signature for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid signatures need to be provided in the scriptSig; prior to this change those invalid signatures would need to be large DER-encoded signatures. Note that we may want to further expand on this change in the future by saying that only OP_0 is a "valid" invalid signature; BIP19 even with this change is inherently malleable as the invalid signatures can be any validly encoded DER signature.
* Fix tests after #5413Wladimir J. van der Laan2015-01-081-2/+2
| | | | | Pull #5413 was not rebased after deterministic signing was merged (#5227), so the testcases had to be regenerated using UPDATE_JSON_TESTS.
* Merge pull request #5143Wladimir J. van der Laan2015-01-081-0/+12
|\ | | | | | | | | | | 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/+12
| | | | | | | | | | 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).
* | minor fix on script test data docsManuel Araoz2014-12-161-1/+1
| |
* | newlines in strings are invalid JSONRyan X. Charles2014-12-021-13/+9
| | | | | | | | | | | | | | | | | | | | Although script_valid.json and script_invalid.json are loaded correctly by the JSON interpreter used by bitcoin core, these same files are often used by other libraries and do not necessarily load correctly due to the fact that newlines contained inside strings are not valid and must instead use the escape character \n. The files tx_valid.json and tx_invalid.json handle this correctly, so I've changed the formatting in script_valid.json and script_invalid.json to mirror those files.
* | Move CHECKMULTISIG order tests out of automatically generated blockPieter Wuille2014-12-011-19/+19
| |
* | Use deterministically generated script testsPieter Wuille2014-12-011-30/+30
|/ | | | | | | 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.
* Test the exact order of CHECKMULTISIG sig/pubkey evaluationPeter Todd2014-11-201-0/+19
| | | | Possible with STRICTENC
* Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille2014-11-201-0/+18
| | | | | | | 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.
* Discourage NOPs reserved for soft-fork upgradesPeter Todd2014-11-171-0/+17
| | | | | | | | | | | | | | | | | NOP1 to NOP10 are reserved for future soft-fork upgrades. In the event of an upgrade such NOPs have *VERIFY behavior, meaning that if their arguments are not correct the script fails. Discouraging these NOPs by rejecting transactions containing them from the mempool ensures that we'll never accept transactions, nor mine blocks, with scripts that are now invalid according to the majority of hashing power even if we're not yet upgraded. Previously this wasn't an issue as the IsStandard() rules didn't allow upgradable NOPs anyway, but 7f3b4e95 relaxed the IsStandard() rules for P2SH redemptions allowing any redeemScript to be spent. We *do* allow upgradable NOPs in scripts so long as they are not executed. This is harmless as there is no opportunity for the script to be invalid post-upgrade.
* Clearly separate PUSHDATA and numeric argument MINIMALDATA testsPeter Todd2014-10-251-15/+44
|
* Test every numeric-accepting opcode for correct handling of the numeric ↵Peter Todd2014-10-251-0/+50
| | | | minimal encoding rule
* Ensure MINIMALDATA invalid tests can only fail one wayPeter Todd2014-10-251-0/+12
| | | | | Removes the need for the 'negated' versions of the tests, and ensures other failures don't mask what we're trying to test.
* Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille2014-10-251-0/+4
| | | | | 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-0/+18
|
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-081-0/+48
| | | | | | | | * 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-13/+72
|
* Add automatic script test generation, and actual checksig testsPieter Wuille2014-09-261-12/+12
|
* Add actual signature testsPieter Wuille2014-09-221-1/+17
|
* Use actually valid transactions for script testsPieter Wuille2014-09-221-0/+9
|
* Make script_{valid,invalid}.json validation flags configurablePieter Wuille2014-09-081-323/+334
|
* script tests: add tests for CHECKMULTISIG limitsOtto Allmendinger2014-07-181-0/+3
|
* script tests: BOOLAND, BOOLOR decode to integerOtto Allmendinger2014-07-181-0/+3
| | | | unlike other boolean checks, arguments >5 bytes invalidate the script
* Merge pull request #3965Wladimir J. van der Laan2014-05-091-0/+3
|\ | | | | | | | | | | | | | | | | b1fdd54 script: Add test for CScriptNum (Cory Fields) 90320d6 script: add additional script tests (Cory Fields) 05e3ecf script: remove bignum dependency (Cory Fields) 4f497cd script: switch outside users to CScriptNum (Cory Fields) 27bff74 script: switch to CScriptNum usage for scripts (Cory Fields) 48d8eb1 script: add CScriptNum class (Cory Fields)
| * script: add additional script testsCory Fields2014-04-221-0/+3
| |
* | Test CHECKMULTISIG with m == 0 and n == 0Peter Todd2014-03-121-0/+16
| |
* | Fix script test handling of empty scriptsPeter Todd2014-03-121-0/+10
|/ | | | Previously an empty script would evaluate to OP_0
* Add script test to prove that OP_0 evaluates as the empty vector, rather ↵Andreas Schildbach2014-03-111-1/+3
| | | | than [0].
* Document and test OP_RESERVED weirdnessPeter Todd2013-08-251-0/+1
| | | | | | 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.
* Add unittests for multiple ELSEs in a rowPeter Todd2013-07-231-1/+15
| | | | | IF ELSE ELSE ENDIF is a valid construct; execution or non-execution inverts on each ELSE encountered.
* Test canonical prunable txout format explicitlyPeter Todd2013-03-011-0/+3
|
* Add coverage for all invalid opsPeter Todd2013-03-011-1/+67
| | | | 0xba thru 0xff
* Add a few test cases to data-driven script tests.Matt Corallo2012-08-201-1/+85
|
* Remove newlines from JSON stringsGavin Andresen2012-05-251-30/+5
| | | | | | Newlines in JSON strings are against the JSON spec, so remove them from the script*.json unit tests to make python's jsonrpc happy (json::spirit didn't care).
* Unit tests for transaction size limitsGavin Andresen2012-05-251-0/+40
|