aboutsummaryrefslogtreecommitdiff
path: root/src/test/data
Commit message (Collapse)AuthorAgeFilesLines
...
* unittest: fix test for null tx inputDaniel Kraft2015-10-271-3/+7
| | | | | | | | | | | Update the unittest that is meant to catch a transaction that is invalid because it has a null input. The old test failed not because of that but because it was considered a coinbase with too large script. This is already checked with a different test, though. The new test is *not* a coinbase since it has two inputs, but one of them is null. This really checks the corresponding code path in CheckTransaction.
* Add DERSIG transaction test casesJ Ross Nicoll2015-10-182-0/+8
| | | | Add test cases for DERSIG flag enforcement against transactions.
* Merge pull request #6544Wladimir J. van der Laan2015-08-191-1/+1
|\ | | | | | | | | c5c1edf Fix spelling mistake in -> if. (Mark Friedenbach) e846b2a Correct a possibly intentional pun that is nevertheless hard to read: "two times of nLockTime." What is meant is that there are two kinds, or categories of nLockTime. (Mark Friedenbach)
| * Fix spelling mistake in -> if.Mark Friedenbach2015-08-101-1/+1
| |
* | Merge pull request #6539Wladimir J. van der Laan2015-08-192-2/+2
|\ \ | |/ |/| | | 9f68ed6 typofixes (found by misspell_fixer) (Veres Lajos)
| * typofixes (found by misspell_fixer)Veres Lajos2015-08-102-2/+2
| |
* | Add support for data-based outputs (OP_RETURN) to bitcoin-tx.Pavel Janík2015-08-063-0/+32
|/
* Merge pull request #6368Wladimir J. van der Laan2015-07-091-0/+8
|\ | | | | | | cb54d17 CLTV: Add more tests to improve coverage (Esteban Ordano)
| * CLTV: Add more tests to improve coverageEsteban Ordano2015-07-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | Four cases included: * The CLTV operand type mismatches the tx locktime. In the script it is 1 (interpreted as block height), but in the tx is 500000000 (interpreted as date) * The stack is empty when executing OP_CLTV * The tx is final by having only one input with MAX_INT sequence number * The operand for CLTV is negative (after OP_0 OP_1 OP_SUB)
* | tests: Fix bitcoin-tx signing testcaseWladimir J. van der Laan2015-07-072-2/+2
|/ | | | | Fixes wrong scriptPubkey problem, which caused the transaction to not actually be signed.
* Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd2015-06-212-0/+106
| | | | | | | | | | | | | | | | <nLockTime> CHECKLOCKTIMEVERIFY -> <nLockTime> Fails if tx.nLockTime < nLockTime, allowing the funds in a txout to be locked until some block height or block time in the future is reached. Only the logic and unittests are implemented; this commit does not have any actual soft-fork logic in it. Thanks to Pieter Wuille for rebase. Credit goes to Gregory Maxwell for the suggestion of comparing the argument against the transaction nLockTime rather than the current time/blockheight directly.
* Add more script edge condition tests.Dave Collins2015-05-062-0/+9
| | | | | | This commit adds some tests to the script_valid.json and tx_invalid.json data which exercise more edge conditions that are not currently being tested.
* 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-272-44/+44
| | | | | 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-102-0/+12
| | | | | | 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-102-2/+2
| | | | | | | 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-032-0/+164
|\ | | | | | | | | | | | | | | 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)
| * Increase coverage of DERSIG edge casesPieter Wuille2015-02-012-0/+20
| |
| * Example unit tests from BIP66Pieter Wuille2015-02-012-0/+144
| |
* | remove sig_canonical.json and sig_noncanonical.jsonManuel Araoz2015-01-312-29/+0
|/
* Make empty byte arrays pass CheckSignatureEncoding()Peter Todd2015-01-092-1/+6
| | | | | | | | | | | | 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-082-5/+5
| | | | | 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-082-0/+30
|\ | | | | | | | | | | 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-252-0/+30
| | | | | | | | | | 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).
* | Remove redundant copyright notices from README filesWladimir J. van der Laan2015-01-021-5/+3
| | | | | | | | | | The normative place for these for the entire project is COPYING, and the main README already has a MIT license section.
* | bitcoin-tx: Add test case for signing a txEric R. Schulz2014-12-242-0/+11
| |
* | Merge pull request #5470Wladimir J. van der Laan2014-12-191-1/+1
|\ \ | | | | | | | | | 78253fc Remove references to X11 licence (Michael Ford)
| * | Remove references to X11 licenceMichael Ford2014-12-161-1/+1
| | |
* | | Merge pull request #5421Wladimir J. van der Laan2014-12-192-0/+21
|\ \ \ | |/ / |/| | | | | cac15be Test unexecuted OP_CODESEPARATOR (Peter Todd)
| * | Test unexecuted OP_CODESEPARATORPeter Todd2014-12-042-0/+21
| |/ | | | | | | | | | | | | | | OP_CODESEPARATOR is an actual executed instruction, not a declarative thing, so if it's wrapped in an OP_IF it can be turned off. Using this to implement Rivest's Paywords is left as an exercise for the reader.
* | minor fix on script test data docsManuel Araoz2014-12-162-2/+2
| |
* | newlines in strings are invalid JSONRyan X. Charles2014-12-022-31/+23
| | | | | | | | | | | | | | | | | | | | 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-012-43/+42
| |
* | Use deterministically generated script testsPieter Wuille2014-12-012-54/+53
|/ | | | | | | 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-202-0/+44
| | | | Possible with STRICTENC
* Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille2014-11-202-9/+27
| | | | | | | 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-172-0/+22
| | | | | | | | | | | | | | | | | 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.
* Add valid invert of invalid every numeric opcode testsPeter Todd2014-10-251-0/+49
|
* Clearly separate PUSHDATA and numeric argument MINIMALDATA testsPeter Todd2014-10-252-30/+114
|
* 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-252-2/+33
| | | | | 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-252-0/+30
|
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-082-10/+100
| | | | | | | | * 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-072-26/+150
|
* Merge pull request #5014Wladimir J. van der Laan2014-10-011-10/+19
|\ | | | | | | 41d67c7 tests: fix python test-runner for windows (Cory Fields)
| * tests: fix python test-runner for windowsCory Fields2014-09-301-10/+19
| | | | | | | | | | | | | | | | | | Windows needed a few fixups to get the tests running: 1. bitcoin-tx needs a file extension in Windows. Take this opportunity to add an env file, which pulls variables out of our build config. This can be extended as needed, for now it's very simple. 2. After #1, split the args out of the exec key in the test data. 3. Correct the line-endings from windows stdout
* | Add automatic script test generation, and actual checksig testsPieter Wuille2014-09-262-24/+25
|/