aboutsummaryrefslogtreecommitdiff
path: root/src/test/data
AgeCommit message (Collapse)Author
2016-06-22BIP144: Serialization, hashes, relay (sender side)Pieter Wuille
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
2016-06-07Merge #7957: [RPC][Bitcoin-TX] Add support for sequence numberWladimir J. van der Laan
ae357d5 [Bitcoin-Tx] Add tests for sequence number support (Jonas Schnelli) e59336f [bitcoin-tx] allow to set nSequence number over the in= command (Jonas Schnelli) a946bb6 [RPC] createrawtransaction: add option to set the sequence number per input (Jonas Schnelli)
2016-06-07[Bitcoin-Tx] Add tests for sequence number supportJonas Schnelli
2016-05-30Adding P2SH(p2pkh) script test caseChris Stewart
Fixing formatting Adding test case into automatically generated test case set Clean up commits removing extra whitespace from eol Removing extra whitespace on macro line
2016-05-11Adding basic tests for OP_CSV inside of script_tests.jsonChris Stewart
Changing NOP3 op name to OP_CHECKSEQUENCEVERIFY, renaming instances of OP_NOP3 in script_tests.json to CHECKSEQUENCEVERIFY Cleaning up NOP3 comment Re-adding test cases that were accidentally deleted, removing dupicated test case, fixing formatting Removing re-labeling of OP_NOP3 to OP_CSV Fixing whitespace issues
2016-04-25Fixing comment in script_test.json test caseChris Stewart
2016-04-05Merge script_valid and script_invalid testsPieter Wuille
2016-04-05Make script_error a mandatory 4th field for script_testsPieter Wuille
2016-04-05Fix some misconstructed testsPieter Wuille
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.
2016-03-18Remove p2p alert handlingBtcDrak
2016-03-14Merge #7517: test: script_error checking in script_invalid testsWladimir J. van der Laan
0ecb340 test: Script_error checking in script_invalid tests (Wladimir J. van der Laan) 2317ad7 test: Re-introduce JSON pretty printing in test builder (Wladimir J. van der Laan) b0ff857 test: Move non-generated script_invalid test to the correct place (Wladimir J. van der Laan)
2016-02-14BIP112: Implement CHECKSEQUENCEVERIFYMark Friedenbach
- Replace NOP3 with CHECKSEQUENCEVERIFY (BIP112) <nSequence> CHECKSEQUENCEVERIFY -> <nSequence> - Fails if txin.nSequence < nSequence, allowing funds of a txout to be locked for a number of blocks or a duration of time after its inclusion in a block. - Pull most of CheckLockTime() out into VerifyLockTime(), a local function that will be reused for CheckSequence() - Add bitwise AND operator to CScriptNum - Enable CHECKSEQUENCEVERIFY as a standard script verify flag - Transactions that fail CSV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CSV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CSV for production use.
2016-02-11test: Script_error checking in script_invalid testsWladimir J. van der Laan
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.
2016-02-11test: Move non-generated script_invalid test to the correct placeWladimir J. van der Laan
This test was introduced in 9fadf1c874f938f87395495776dbae896551873d, but accidentally added in the autogenerated area.
2015-12-15Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY.mb300sd
2015-10-27unittest: fix test for null tx inputDaniel Kraft
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.
2015-10-18Add DERSIG transaction test casesJ Ross Nicoll
Add test cases for DERSIG flag enforcement against transactions.
2015-08-19Merge pull request #6544Wladimir J. van der Laan
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)
2015-08-19Merge pull request #6539Wladimir J. van der Laan
9f68ed6 typofixes (found by misspell_fixer) (Veres Lajos)
2015-08-10Fix spelling mistake in -> if.Mark Friedenbach
2015-08-10typofixes (found by misspell_fixer)Veres Lajos
2015-08-06Add support for data-based outputs (OP_RETURN) to bitcoin-tx.Pavel Janík
2015-07-09Merge pull request #6368Wladimir J. van der Laan
cb54d17 CLTV: Add more tests to improve coverage (Esteban Ordano)
2015-07-07tests: Fix bitcoin-tx signing testcaseWladimir J. van der Laan
Fixes wrong scriptPubkey problem, which caused the transaction to not actually be signed.
2015-07-06CLTV: Add more tests to improve coverageEsteban Ordano
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)
2015-06-21Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd
<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.
2015-05-06Add more script edge condition tests.Dave Collins
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.
2015-04-29Merge pull request #6075Wladimir J. van der Laan
9fadf1c Add additional script edge condition tests. (Dave Collins)
2015-04-28Add additional script edge condition tests.Dave Collins
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.
2015-04-27Correct the PUSHDATA4 minimal encoding test.Dave Collins
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.
2015-03-27Switch test case signing to RFC6979 extra entropyPieter Wuille
Instead of manually tweaking the deterministic nonce post-generation, pass the test case number in as extra entropy to RFC6979.
2015-02-10Add test for DER-encoding edge caseSuhas Daftuar
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.
2015-02-10Fix NegateSignatureS to not duplicate last byte of SSuhas Daftuar
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.
2015-02-03Merge pull request #5713Wladimir J. van der Laan
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)
2015-02-01Increase coverage of DERSIG edge casesPieter Wuille
2015-02-01Example unit tests from BIP66Pieter Wuille
2015-01-31remove sig_canonical.json and sig_noncanonical.jsonManuel Araoz
2015-01-09Make 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.
2015-01-08Fix tests after #5413Wladimir J. van der Laan
Pull #5413 was not rebased after deterministic signing was merged (#5227), so the testcases had to be regenerated using UPDATE_JSON_TESTS.
2015-01-08Merge pull request #5143Wladimir J. van der Laan
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)
2015-01-02Remove redundant copyright notices from README filesWladimir J. van der Laan
The normative place for these for the entire project is COPYING, and the main README already has a MIT license section.
2014-12-24bitcoin-tx: Add test case for signing a txEric R. Schulz
2014-12-19Merge pull request #5470Wladimir J. van der Laan
78253fc Remove references to X11 licence (Michael Ford)
2014-12-19Merge pull request #5421Wladimir J. van der Laan
cac15be Test unexecuted OP_CODESEPARATOR (Peter Todd)
2014-12-16Remove references to X11 licenceMichael Ford
2014-12-16minor fix on script test data docsManuel Araoz
2014-12-04Test unexecuted OP_CODESEPARATORPeter Todd
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.
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.