aboutsummaryrefslogtreecommitdiff
path: root/src/test/data/script_valid.json
AgeCommit message (Collapse)Author
2015-02-01Increase coverage of DERSIG edge casesPieter Wuille
2015-02-01Example unit tests from BIP66Pieter Wuille
2015-01-26Make empty byte arrays pass CheckSignatureEncoding()Peter Todd
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. Rebased-From: 2fa9a8ec86033b809a1c48f0396c3482c0d5d33c Github-Pull: #5627
2014-12-02newlines in strings are invalid JSONRyan X. Charles
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.
2014-12-01Move CHECKMULTISIG order tests out of automatically generated blockPieter Wuille
2014-12-01Use deterministically generated script testsPieter Wuille
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.
2014-11-20Test the exact order of CHECKMULTISIG sig/pubkey evaluationPeter Todd
Possible with STRICTENC
2014-11-20Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille
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.
2014-11-17Discourage NOPs reserved for soft-fork upgradesPeter Todd
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.
2014-10-25Add valid invert of invalid every numeric opcode testsPeter Todd
2014-10-25Clearly separate PUSHDATA and numeric argument MINIMALDATA testsPeter Todd
2014-10-25Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille
Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
2014-10-25Add SCRIPT_VERIFY_SIGPUSHONLY (BIP62 rule 2)Pieter Wuille
2014-10-08Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille
* 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.
2014-10-07Prettify JSON tests and minimize diffsPieter Wuille
2014-09-26Add automatic script test generation, and actual checksig testsPieter Wuille
2014-09-22Add actual signature testsPieter Wuille
2014-09-22Use actually valid transactions for script testsPieter Wuille
2014-09-08Make script_{valid,invalid}.json validation flags configurablePieter Wuille
2014-07-18script test: test case for 5-byte boolsOtto Allmendinger
2014-07-18script tests: value with trailing 0x00 is trueOtto Allmendinger
2014-07-18script tests: values that overflow to 0 are trueOtto Allmendinger
2014-07-18additional test for OP_SIZE in script_valid.jsonOtto Allmendinger
2014-05-09Merge pull request #3965Wladimir J. van der Laan
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)
2014-04-22script: add additional script testsCory Fields
2014-03-12Test CHECKMULTISIG with m == 0 and n == 0Peter Todd
2014-03-12Fix script test handling of empty scriptsPeter Todd
Previously an empty script would evaluate to OP_0
2014-03-11Add script test to prove that OP_0 evaluates as the empty vector, rather ↵Andreas Schildbach
than [0].
2013-11-08Add a few more basic script/tx test-cases.Matt Corallo
2013-08-25Document and test OP_RESERVED weirdnessPeter Todd
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.
2013-08-06More unit tests for NUMEQUALGavin Andresen
2013-07-23Add unittests for multiple ELSEs in a rowPeter Todd
IF ELSE ELSE ENDIF is a valid construct; execution or non-execution inverts on each ELSE encountered.
2013-03-01Test canonical prunable txout format explicitlyPeter Todd
2013-03-01Add coverage for all invalid opsPeter Todd
0xba thru 0xff
2012-08-20Add a few test cases to data-driven script tests.Matt Corallo
2012-05-25Remove newlines from JSON stringsGavin Andresen
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).
2012-05-25Unit tests for transaction size limitsGavin Andresen
2012-05-24Lots more Script unit test cases.Gavin Andresen
2012-05-24More CScript unit tests.Gavin Andresen
2012-04-21Data-drive script evaluation unit tests.Gavin Andresen