Commit Graph

148 Commits

Author SHA1 Message Date
John Newbery 63d66ba20a Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py 2017-03-20 10:40:31 -04:00
MarcoFalke 88c2ae3ed2
Merge #9350: [Trivial] Adding label for amount inside of tx_valid/tx_invalid.json
988ce2d Adding 'amount' label to tx_valid/tx_invalid.json files (Chris Stewart)

Tree-SHA512: 11c216c6565ecaa5ff4eb6122f87d3b28f89db52d1e473c0678f61c240e133698adb05e717bfb9d3db36409dfb230b902dca4029a58633be36c9f85e0db3d973
2017-02-27 22:33:55 +01:00
John Newbery 0c50909347 testcases: explicitly specify transaction version 1 2017-01-09 16:42:45 -05:00
jnewbery b7e144bb73 Add test cases to test new bitcoin-tx functionality
This commit add testcases to test the following functions in bitcoin-tx:

- add a pay to non-standard script output
- add a P2SH output
- add a P2WSH output
- add a P2WSH wrapped in a P2SH output
- add a pay to pub key output
- add a P2WPKH output
- add a P2WPKH wrapped in a P2SH output
- add a bare multisig output
- add a multisig in P2SH output
- add a multisig in a P2WSH output
- add a multisig in a P2WSH wrapped in as P2SH output
2016-12-29 15:40:40 +00:00
Douglas Roark b3717326c1 Re-enable a blank v1 Tx JSON test 2016-12-21 13:41:47 -08:00
BtcDrak 23208ac81b
Remove unused test files and references 2016-12-19 07:43:12 +00:00
Chris Stewart 988ce2ddef Adding 'amount' label to tx_valid/tx_invalid.json files 2016-12-15 19:04:56 -06:00
Wladimir J. van der Laan 1eef038b1b
Merge #7562: Bump transaction version default to 2
c5c92c4 Update python tests for default tx version=2 (BtcDrak)
dab207e Preserve tx version=1 for certain tests (BtcDrak)
c5d746a tiny test fix for mempool_tests (Alex Morcos)
1f0ca1a Bump default transaction version to 2 (BtcDrak)
2016-12-15 17:03:31 +01:00
Richard Kiss e49a252bae Fix spelling. 2016-12-12 16:06:59 -05:00
BtcDrak c5c92c46fb
Update python tests for default tx version=2 2016-12-08 20:12:00 +00:00
MarcoFalke 97ec6e5c90
Merge #9100: tx_valid: re-order inputs to how they are encoded
5262a15 tx_valid: re-order inputs to how they are encoded (Daniel Cousens)
2016-11-25 10:38:19 +01:00
Daniel Cousens 5262a151e1 tx_valid: re-order inputs to how they are encoded 2016-11-08 11:58:39 +11:00
jnewbery 7451cf59cd Allow bitcoin-tx to parse partial transactions
Restore pre V0.13.1 functionality to bitcoin-tx and allow it to parse 0-input partial transactions.
2016-11-04 09:10:44 +00:00
Wladimir J. van der Laan 475d68252e
Merge #8927: Add script tests for FindAndDelete in pre-segwit and segwit scripts
acf853d Add script tests for FindAndDelete in pre-segwit and segwit scripts (Johnson Lau)
2016-10-19 17:41:34 +02:00
Johnson Lau 9260085377 test segwit uncompressed key fixes 2016-10-17 00:34:37 +08:00
Johnson Lau acf853df91 Add script tests for FindAndDelete in pre-segwit and segwit scripts 2016-10-16 00:30:50 +08:00
Wladimir J. van der Laan e2b8c394d6
Merge #8817: update bitcoin-tx to output witness data
4408558 Update bitcoin-tx to output witness data. (jonnynewbs)
2016-10-13 18:56:43 +02:00
jnewbery 621441a7a7 add verbose mode to bitcoin-util-test.py 2016-10-05 09:16:08 -04:00
jonnynewbs 4408558843 Update bitcoin-tx to output witness data. 2016-10-05 09:00:34 -04:00
jnewbery da94697708 bitcoin-util-test.py should fail if the output file is empty 2016-09-29 10:16:56 -04:00
MarcoFalke 8ca69a2a88
Merge #8829: Add bitcoin-tx JSON tests
54e5d7c Add bitcoin-tx JSON tests (jnewbery)
2016-09-29 10:50:05 +02:00
jnewbery 54e5d7c1b8 Add bitcoin-tx JSON tests 2016-09-28 13:38:42 -04:00
Johnson Lau e41bd449ab Add policy: null signature for failed CHECK(MULTI)SIG 2016-09-27 23:40:59 +08:00
Johnson Lau c72c5b1e3b Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH 2016-09-23 13:07:38 +08:00
BtcDrak 14d01309be Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY 2016-06-28 17:17:36 +01:00
Suhas Daftuar d846e02372 [qa] script_tests: witness tests can specify tx amount
Add tests that witness signatures cover value
2016-06-22 15:43:02 +02:00
Suhas Daftuar 330b0f31ee [qa] p2p segwit tests
mininode now supports witness transactions/blocks, blocktools
has a helper for adding witness commitments to blocks, and script
has a function to calculate hashes for signature under sigversion
1, used by segwit.

Py3 conversion by Marco Falke

Test to make sure upgraded nodes don't ask for non-wit blocks by
Gregory Sanders.
2016-06-22 15:43:02 +02:00
Pieter Wuille 66cca79130 [qa] Autogeneration support for witness in script_tests 2016-06-22 15:43:01 +02:00
Pieter Wuille 06d3805c1a [qa] Add segwit support to script_tests
Contains fix by Johnson Lau.
2016-06-22 15:43:01 +02:00
NicolasDorier 00f46cbcd9 [qa] Add transaction tests for segwit
Including BIP143 P2WSH examples by jl2012.
2016-06-22 15:43:01 +02:00
Pieter Wuille 7030d9eb47 BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo.
Contains fixup by Nicolas Dorier.
Contains cleanup of CInv::GetCommand by Alex Morcos
2016-06-22 15:42:59 +02:00
Wladimir J. van der Laan 79004d4ae6
Merge #7957: [RPC][Bitcoin-TX] Add support for sequence number
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 18:25:13 +02:00
Jonas Schnelli ae357d5ab9
[Bitcoin-Tx] Add tests for sequence number support 2016-06-07 17:37:35 +02:00
Chris Stewart b682960a28 Adding P2SH(p2pkh) script test case
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-30 08:51:37 -05:00
Chris Stewart 10e83d7956 Adding basic tests for OP_CSV inside of script_tests.json
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-05-11 08:00:48 -05:00
Chris Stewart 62a9abd12b Fixing comment in script_test.json test case 2016-04-25 11:08:10 -05:00
Pieter Wuille dde46d3ae1 Merge script_valid and script_invalid tests 2016-04-05 16:11:47 +02:00
Pieter Wuille 76da761351 Make script_error a mandatory 4th field for script_tests 2016-04-05 15:46:16 +02:00
Pieter Wuille 269281b7cc Fix some misconstructed tests
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-04-05 14:54:37 +02:00
BtcDrak bbb9d1d123 Remove p2p alert handling 2016-03-18 19:33:59 +00:00
Wladimir J. van der Laan f1ca8915bb
Merge #7517: test: script_error checking in script_invalid tests
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-03-14 11:30:06 +01:00
Mark Friedenbach 53e53a33c9 BIP112: Implement CHECKSEQUENCEVERIFY
- 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-14 11:29:38 +00:00
Wladimir J. van der Laan 0ecb3401fe test: Script_error checking in script_invalid tests
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-11 17:33:28 +01:00
Wladimir J. van der Laan b0ff8572ae test: Move non-generated script_invalid test to the correct place
This test was introduced in 9fadf1c874,
but accidentally added in the autogenerated area.
2016-02-11 16:16:40 +01:00
mb300sd 37d271d7cc Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY. 2015-12-15 02:01:45 -05:00
Daniel Kraft 0be387a536 unittest: fix test for null tx input
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-27 20:11:56 +01:00
J Ross Nicoll c6824f8a90 Add DERSIG transaction test cases
Add test cases for DERSIG flag enforcement against transactions.
2015-10-18 17:27:41 +01:00
Wladimir J. van der Laan ef30389e2a
Merge pull request #6544
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-19 17:37:52 +02:00
Wladimir J. van der Laan 80cddbbba9
Merge pull request #6539
9f68ed6 typofixes (found by misspell_fixer) (Veres Lajos)
2015-08-19 17:28:00 +02:00
Mark Friedenbach c5c1edfe60 Fix spelling mistake in -> if. 2015-08-10 18:09:59 -07:00