Commit graph

326 commits

Author SHA1 Message Date
Wladimir J. van der Laan d2e987aa19
Merge pull request #6958
9c3ee3b [doc] Add -maxuploadtarget release notes (MarcoFalke)
b27e81f [net] Cleanup maxuploadtarget (MarcoFalke)
2015-11-13 13:27:33 +01:00
Jeff Garzik 38ed190eef
Merge #6771 from branch 'lowerLimits' of git://github.com/morcos/bitcoin 2015-11-12 15:38:59 -05:00
MarcoFalke b27e81f115 [net] Cleanup maxuploadtarget
* log: nMaxOutboundLimit is in bytes
* log: Hide misleading -maxuploadtarget=0 warning
* qa : Minor cleanup to maxuploadtarget rpc tests
* net: Use DEFAULT_MAX_UPLOAD_TARGET = 0
2015-11-12 20:45:57 +01:00
Wladimir J. van der Laan 5fcc14ee05
Merge pull request #6804
b5cbd39 Add basic coverage reporting for RPC tests (James O'Beirne)
2015-11-12 08:22:36 +01:00
James O'Beirne b5cbd396ca Add basic coverage reporting for RPC tests
Thanks to @MarcoFalke @dexX7 @laanwj for review.
2015-11-11 10:33:43 -08:00
Suhas Daftuar 97203f5606
Port test to rpc-test framework 2015-11-10 14:14:46 -05:00
Wladimir J. van der Laan 2980a18572 Fix crash in validateaddress with -disablewallet
Fix a null pointer dereference in validateaddress with -disablewallet. Also add a regression testcase.
2015-11-09 08:44:19 +01:00
Wladimir J. van der Laan 26752767df
Merge pull request #6894
3e187f2 Fix BIP65 p2p test (Suhas Daftuar)
2015-10-29 13:12:47 +01:00
Alex Morcos 971a4e6b86 Lower default policy limits
Reduce the default limits on maximum number of transactions and the cumulative size of those transactions in both ancestor and descendant packages to 25 txs and 101kb total size.
2015-10-27 23:59:19 -04:00
Pieter Wuille 298e040bca Fix chainstate serialized_size computation 2015-10-28 01:05:32 +01:00
Suhas Daftuar 3e187f2acd Fix BIP65 p2p test
create_coinbase() was being called with the wrong arguments
2015-10-27 15:36:06 -04:00
Suhas Daftuar 17a073ae06
Add RPC test for -maxuploadtarget 2015-10-26 15:40:38 +01:00
Wladimir J. van der Laan 2a1090d4f5
Merge pull request #6351
65ef372 Add BIP65 to getblockchaininfo softforks list (Peter Todd)
cde7ab2 Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork (Peter Todd)
287f54f Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic (Peter Todd)
2015-10-23 13:33:13 +02:00
Wladimir J. van der Laan 0fbfc5106c
Merge pull request #6859
41db8c4 http: Restrict maximum size of request line + headers (Wladimir J. van der Laan)
2015-10-21 11:19:25 +02:00
Wladimir J. van der Laan 41db8c4733 http: Restrict maximum size of request line + headers
Prevent memory exhaustion by sending lots of data.
Also add a test to `httpbasics.py`.

Closes #6425
2015-10-20 14:31:40 +02:00
Wladimir J. van der Laan 020c4073a0
Merge pull request #6841
b6d5e32 Make fee aware of min relay in pruning.py RPC test (Alex Morcos)
2015-10-20 12:53:45 +02:00
MarcoFalke 0d8b1759d2 [rpc-tests] fundrawtransaction: Update fee after minRelayTxFee increase 2015-10-20 10:25:45 +02:00
Alex Morcos b6d5e32e0e Make fee aware of min relay in pruning.py RPC test 2015-10-17 15:52:40 -04:00
Wladimir J. van der Laan 9caaf6ed22
Merge pull request #6777
dcd8e27 Refer to obfuscate_key via pointer in peripheral CLevelDB classes (James O'Beirne)
1488506 Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator (James O'Beirne)
0fdf8c8 Handle obfuscation in CLevelDBIterator (James O'Beirne)
3499ce1 Encapsulate CLevelDB iterators cleanly (Pieter Wuille)
2015-10-13 12:23:45 +02:00
James O'Beirne 1488506872 Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.
2015-10-09 10:56:39 -07:00
MarcoFalke d0321a4cfd [doc] trivial: fix markdown syntax in qa/rpc-tests/README.md 2015-10-09 17:09:29 +02:00
Peter Todd cde7ab2d4e Add RPC tests for the CHECKLOCKTIMEVERIFY (BIP65) soft-fork
bip65-cltv.py is based on the earlier BIP66 soft-fork RPC test
implemented by Pieter Wuille's 819bcf9b99

bip65-cltv-p2p.py is based on the earlier BIP66 P2P test by Suhas
Daftuar's d76412b068
2015-10-08 17:25:25 +02:00
ptschip 5467820be5 Migrated rpc-tests.sh to all python rpc-tests.py
1) created rpc-tests.py
2) deleted rpc-tests.sh
3) travis.yml points to rpc-tests.py
4) Modified Makefile.am
5) Updated README.md
6) Added tests_config.py and deleted tests-config.sh
7) Modified configure.ac with script to set correct path in tests_config.py
2015-10-01 11:28:11 -07:00
Wladimir J. van der Laan 17d0e638b6
Merge pull request #6686
745f909 travis: install a recent libzmq and pyzmq for tests (Cory Fields)
a9c27cd [travis] add zmq python module (Jonas Schnelli)
110a1fd enable zmq-test in rpc-tests.sh (Jonas Schnelli)
2015-10-01 16:22:26 +02:00
Cory Fields 745f909925 travis: install a recent libzmq and pyzmq for tests 2015-10-01 15:40:57 +02:00
Jonas Schnelli a9c27cdf55 [travis] add zmq python module 2015-10-01 14:02:26 +02:00
Wladimir J. van der Laan 48efbdbe98
Merge pull request #5264
af3208b Resolve issue 3166. These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts. This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa. (mruddy)
2015-09-25 19:19:07 +02:00
Suhas Daftuar 598b25d5ee Add test showing bug in mempool packages 2015-09-23 15:12:19 -04:00
Wladimir J. van der Laan e59d2a80f9
Merge pull request #6315
7aac6db [QT] dump banlist to disk in case of ban/unban over QT (Jonas Schnelli)
7f90ea7 [QA] adabt QT_NO_KEYWORDS for QT ban implementation (Jonas Schnelli)
07f70b2 [QA] fix netbase tests because of new CSubNet::ToString() output (Jonas Schnelli)
4ed0510 [Qt] call DumpBanlist() when baning unbaning nodes (Philip Kaufmann)
be89292 [Qt] reenabling hotkeys for ban context menu, use different words (Jonas Schnelli)
b1189cf [Qt] adapt QT ban option to banlist.dat changes (Jonas Schnelli)
65abe91 [Qt] add sorting for bantable (Philip Kaufmann)
51654de [Qt] bantable polish (Philip Kaufmann)
cdd72cd [Qt] simplify ban list signal handling (Philip Kaufmann)
43c1f5b [Qt] remove unused timer-code from banlistmodel.cpp (Jonas Schnelli)
e2b8028 net: Fix CIDR notation in ToString() (Wladimir J. van der Laan)
9e521c1 [Qt] polish ban table (Philip Kaufmann)
607809f net: use CIDR notation in CSubNet::ToString() (Jonas Schnelli)
53caec6 [Qt] bantable overhaul (Jonas Schnelli)
f0bcbc4 [Qt] bantable fix timestamp 64bit issue (Jonas Schnelli)
6135309 [Qt] banlist, UI optimizing and better signal handling (Jonas Schnelli)
770ca79 [Qt] add context menu with unban option to ban table (Jonas Schnelli)
5f42132 [Qt] add ui signal for banlist changes (Jonas Schnelli)
ad204df [Qt] add banlist table below peers table (Jonas Schnelli)
50f0908 [Qt] add ban functions to peers window (Jonas Schnelli)
2015-09-22 13:39:38 +02:00
Wladimir J. van der Laan 5e21388c48
Merge pull request #6695
ddf98d1 Make RPC tests cope with server-side timeout between requests (Wladimir J. van der Laan)
2190ea6 rpc: Split option -rpctimeout into -rpcservertimeout and -rpcclienttimeout (Wladimir J. van der Laan)
8b2d6ed http: Disable libevent debug logging, if not explicitly enabled (Wladimir J. van der Laan)
5ce43da init: Ignore SIGPIPE (Wladimir J. van der Laan)
2015-09-21 17:16:40 +02:00
Wladimir J. van der Laan ddf98d1d84 Make RPC tests cope with server-side timeout between requests
Python's httplib does not graciously handle disconnections from the http server, resulting in BadStatusLine errors.
See https://bugs.python.org/issue3566 "httplib persistent connections violate MUST in RFC2616 sec 8.1.4."

This was fixed in Python 3.5.

Work around it for now.
2015-09-21 17:15:37 +02:00
Suhas Daftuar 5add7a74a6 Track transaction packages in CTxMemPoolEntry
Associate with each CTxMemPoolEntry all the size/fees of descendant
mempool transactions.  Sort mempool by max(feerate of entry, feerate
of descendants).  Update statistics on-the-fly as transactions enter
or leave the mempool.

Also add ancestor and descendant limiting, so that transactions can
be rejected if the number or size of unconfirmed ancestors exceeds
a target, or if adding a transaction would cause some other mempool
entry to have too many (or too large) a set of unconfirmed in-
mempool descendants.
2015-09-19 13:25:48 -04:00
Jonas Schnelli 07f70b2dde [QA] fix netbase tests because of new CSubNet::ToString() output 2015-09-16 16:50:20 +02:00
Jonas Schnelli 029e278286 QA: Add ZeroMQ RPC test 2015-09-16 11:01:35 +01:00
Wladimir J. van der Laan ee2a42b447 tests: GET requests cannot have request body, use POST in rest.py
Sending a request body with GET request is not valid in HTTP spec, and
not compatible with evhttpd.
2015-09-02 18:38:42 +02:00
Wladimir J. van der Laan 8f9301cdaa qa: Remove -rpckeepalive tests from httpbasics
This option was a temporary workaround, and is no longer necessary
with the new web server.
2015-09-02 18:38:41 +02:00
ptschip 060058e955 Enable python tests for Native Windows
1) Multiplatorm support for devnull
2) Fixed a bug in the handling of cache files
3) Deleted run-bitcoin-cli as no longer needed
2015-08-26 10:59:22 -07:00
Casey Rodarmor 0ce73985a8 Add p2p-fullblocktest.py 2015-08-21 15:31:37 -04: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
Daniel Kraft 2016576998 Fix crash when mining with empty keypool.
Since the introduction of the ScriptForMining callback, the mining
functions (setgenerate and generate) crash with an assertion failure
(due to a NULL pointer script returned) if the keypool is empty.  Fix
this by giving a proper error.
2015-08-18 09:07:33 +02:00
Wladimir J. van der Laan bb4faee21e
Merge pull request #6509
45a6cce Fix race condition on test node shutdown (Casey Rodarmor)
2015-08-17 16:45:22 +02:00
Jeff Garzik 6feeec1ec5
Merge pull request #6013 2015-08-15 16:09:06 -04:00
Wladimir J. van der Laan ddd8d80c63
Merge pull request #6415
d042854 SQUASH "Implement watchonly support in fundrawtransaction" (Matt Corallo)
428a898 SQUASH "Add have-pubkey distinction to ISMINE flags" (Matt Corallo)
6bdb474 Implement watchonly support in fundrawtransaction (Matt Corallo)
f5813bd Add logic to track pubkeys as watch-only, not just scripts (Matt Corallo)
d3354c5 Add have-pubkey distinction to ISMINE flags (Matt Corallo)
5c17059 Update importaddress help to push its use to script-only (Matt Corallo)
a1d7df3 Add importpubkey method to import a watch-only pubkey (Matt Corallo)
907a425 Add p2sh option to importaddress to import redeemScripts (Matt Corallo)
983d2d9 Split up importaddress into helper functions (Matt Corallo)
cfc3dd3 Also remove pay-2-pubkey from watch when adding a priv key (Matt Corallo)
2015-08-14 16:28:37 +02:00
Pavel Janík 70180b2e57 Implement REST mempool API, add test and documentation. 2015-08-14 07:01:03 +02:00
Casey Rodarmor 45a6cce971 Fix race condition on test node shutdown 2015-08-12 11:02:43 -04:00
Veres Lajos 9f68ed6b6d typofixes (found by misspell_fixer) 2015-08-10 22:06:27 +01:00
mruddy af3208bfa6 Resolve issue 3166.
These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts.
This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa.
2015-07-30 19:56:00 -04:00
Wladimir J. van der Laan 675d2feffa
Merge pull request #6224
59b49cd Eliminate signed/unsigned comparison warning (Suhas Daftuar)
04b5d23 Replace sleep with syncing using pings (Suhas Daftuar)
6b1066f Ignore whitelisting during IBD for unrequested blocks. (Suhas Daftuar)
bfc30b3 Ignore unrequested blocks too far ahead of tip (Suhas Daftuar)
2015-07-29 20:04:15 +02:00
Jonas Schnelli 7d226b7ca0 [QA] add testcases for parsing strings as values 2015-07-27 13:55:46 +02:00
Wladimir J. van der Laan bfd807ff32
Merge pull request #6456
ec249d4 util: use locale-independent parsing in ParseDouble (Wladimir J. van der Laan)
7650449 univalue: Avoid unnecessary roundtrip through double for numbers (Wladimir J. van der Laan)
e061e27 rpc: Make ValueFromAmount always return 8 decimals (Wladimir J. van der Laan)
2015-07-24 11:08:52 +02:00
Casey Rodarmor 56b28fca46 Don't share objects between TestInstances 2015-07-22 12:03:16 -04:00
Matt Corallo 6bdb474dc9 Implement watchonly support in fundrawtransaction
Some code and test cases stolen from
Bryan Bishop <bryan@ledgerx.com> (pull #5524).
2015-07-20 16:01:38 -07:00
Matt Corallo 907a425aa5 Add p2sh option to importaddress to import redeemScripts 2015-07-20 16:01:37 -07:00
zathras-crypto 0aad1f13b2
Exempt unspendable transaction outputs from dust checks
Since unspendable outputs can't be spent, there is no threshold at which it would be uneconomic to spend them.

This primarily targets transaction outputs with `OP_RETURN`.

---

Initially based on:

commit 9cf0ae26350033d43d5dd3c95054c0d1b1641eda
Author: zathras-crypto <zathrasc@gmail.com>
Date:   Wed Mar 25 02:04:02 2015 -0700

Changes:

- cherry-picked on top of bitcoin:master
- added RPC test for fundrawtransaction
2015-07-18 17:31:55 +02:00
Wladimir J. van der Laan 7650449a67 univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code
doesn't need to do so either.

This removes VREAL, as well as its specific post-processing in
`UniValue::write`. Non-monetary amounts do not need to be forcibly
formatted with 8 decimals, so the extra roundtrip was unnecessary
(and potentially loses precision).
2015-07-18 09:04:18 +02:00
fanquake db42558b82 Remove bash test note from rpc-tests readme 2015-07-15 16:28:49 +08:00
Wladimir J. van der Laan ffad5aa1f4 tests: Remove old sh-based test framework
This removes the `conflictedbalance.sh` test as well, but that test has
been broken for a long time and isn't part of any scripts.
What it does is, IMO, sufficiently tested by other tests.
2015-07-13 08:50:16 +02:00
Jonas Schnelli 9da8fc8f26 [QA] remove rawtransactions.py from the extended test list
rawtransactions.py is already in the standard test list
2015-07-10 22:01:41 +02:00
Jonas Schnelli 6ed38b0b8f [QA] fix possible reorg issue in rawtransaction.py/fundrawtransaction.py RPC test
- added missing mempool sync between block generations
2015-07-10 21:13:33 +02:00
Wladimir J. van der Laan 5121c68657
Merge pull request #6414
8a0b933 Fix intermittent test failure, reduce test time (Tom Harding)
2015-07-10 18:52:43 +02:00
Tom Harding 8a0b933aae Fix intermittent test failure, reduce test time
In txn_clone.py, non-essential test transaction tx2 was asserted
to be unconfirmed, but would occasionally confirm depending on
network behavior.  Fix by explicitly sharing with miner and
checking for 1 confirmation.

Reduce required conflict tests from 4 to 2, by moving one invocation
each of txn_clone.py and txn_doublespend.py to the extented test
section.  This saves about 15 seconds per test run for me.
2015-07-09 18:10:57 -07:00
Jonas Schnelli c45c7ea0fa [REST] add JSON support for /rest/headers/ 2015-07-05 15:48:33 +02:00
Wladimir J. van der Laan 56dc70439f
tests: fix txn_clone.py (retry)
There was a stale .pyc file around from before the move. This should
catch all missing modules and finally fix the travis build.
2015-07-02 23:23:29 +02:00
Wladimir J. van der Laan 66e5465773
Merge pull request #6310
177a0e4 Adding CSubNet constructor over a single CNetAddr (Jonas Schnelli)
409bccf use CBanEntry as object container for banned nodes (Jonas Schnelli)
dfa174c CAddrDB/CBanDB: change filesize variables from int to uint64_t (Jonas Schnelli)
f581d3d banlist.dat: store banlist on disk (Jonas Schnelli)
2015-07-02 21:33:09 +02:00
Wladimir J. van der Laan 3f16971442
tests: fix txn_clone.py
Solve merge conflict of test added in #5881 with #6097.
2015-07-02 20:39:44 +02:00
Jonas Schnelli f581d3d656 banlist.dat: store banlist on disk 2015-07-02 20:29:36 +02:00
Wladimir J. van der Laan 3203a0832a
Merge pull request #5881
5d34e16 Add txn_clone.py test (Tom Harding)
defd2d5 Better txn_doublespend.py test (Tom Harding)
b2b3619 Implement CTransaction::IsEquivalentTo(...) (Tom Harding)
2015-07-02 19:59:50 +02:00
mruddy 70ae43e9b7 add tests for the decodescript rpc. add mention of the rpc regression tests to the testing seciton of the main readme. 2015-06-30 09:45:49 -04:00
Suhas Daftuar 04b5d235f1 Replace sleep with syncing using pings 2015-06-30 09:42:56 -04:00
Wladimir J. van der Laan 91389e51c7
Merge pull request #6088
2085895 fundrawtransaction tests (Jonas Schnelli)
21bbd92 Add fundrawtransaction RPC method (Matt Corallo)
1e0d1a2 Add FundTransaction method to wallet (Matt Corallo)
2d84e22 Small tweaks to CCoinControl for fundrawtransaction (Matt Corallo)
9b4e7d9 Add DummySignatureCreator which just creates zeroed sigs (Pieter Wuille)
2015-06-23 12:40:00 +02:00
Wladimir J. van der Laan 40400d53d3
Merge pull request #6272
edbdf88 tests: Extend RPC proxy tests (Wladimir J. van der Laan)
baf0507 Improve proxy initialization (Wladimir J. van der Laan)
2015-06-18 17:53:36 +02:00
Jonas Schnelli 9d79afe9a9 add RPC tests for setban & disconnectnode 2015-06-17 21:40:56 +02:00
Jonas Schnelli 433fb1a95d [RPC] extend setban to allow subnets 2015-06-17 21:40:55 +02:00
Jonas Schnelli 1086ffba26 [QA] add setban/listbanned/clearbanned tests 2015-06-17 21:40:55 +02:00
Wladimir J. van der Laan edbdf8855d tests: Extend RPC proxy tests
Also test -noonion
2015-06-15 12:45:13 +02:00
Stephen ef2a3de25c Add paytxfee to getwalletinfo, warnings to getnetworkinfo 2015-06-11 16:12:34 -04:00
Jonas Schnelli 208589514c fundrawtransaction tests 2015-06-11 01:03:23 -07:00
Suhas Daftuar bfc30b3437 Ignore unrequested blocks too far ahead of tip 2015-06-03 11:36:04 -04:00
Suhas Daftuar aa8c827968 P2P regression test for new AcceptBlock behavior 2015-06-02 14:01:35 -04:00
Wladimir J. van der Laan 42746b0476
Merge pull request #6193
6e71efa [REST] remove json input for getutxos, limit to query max. 15 outpoints (Jonas Schnelli)
64b8027 rest.cpp: strip whitespace (Jonas Schnelli)
2015-06-01 09:48:17 +02:00
Jonas Schnelli 6e71efa9f0 [REST] remove json input for getutxos, limit to query max. 15 outpoints
Remove possibility to send json encoded parameters to `/rest/getutxos/` to avoid possible DoS scenarios.

The JSON output option is untouched.
2015-05-27 20:10:02 +02:00
Suhas Daftuar ee9a2e4271 Fix walletbackup.py after directory restructuring
Also add walletbackup.py to rpc-tests.sh
2015-05-27 10:00:15 -04:00
Jonas Schnelli 7b7f258396 rpc-tests: remove python-bitcoinrpc directory
place authproxy.py at same level as other utility classes
2015-05-21 21:22:22 +02:00
Jonas Schnelli 3e875b1bef pull-tester/rpc-tests.sh: allow passing throug of arguments 2015-05-18 15:29:20 +02:00
Jonas Schnelli 00706a5436 update rpc-tests readme.md 2015-05-18 15:25:45 +02:00
Jonas Schnelli 64937fe51a [QA] restructure rpc tests directory
* move non-test classes to subdir `test-framework`
2015-05-18 15:25:45 +02:00
Alex Morcos 8f0947be34 Increase timeouts in pruning.py and modify warning language. 2015-05-13 15:02:36 -04:00
Wladimir J. van der Laan 2cc1372190
Merge pull request #5159
b649e03 Create new BlockPolicyEstimator for fee estimates (Alex Morcos)
2015-05-13 17:10:02 +02:00
Alex Morcos b649e03954 Create new BlockPolicyEstimator for fee estimates
This class groups transactions that have been confirmed in blocks into buckets, based on either their fee or their priority.  Then for each bucket, the class calculates what percentage of the transactions were confirmed within various numbers of blocks.  It does this by keeping an exponentially decaying moving history for each bucket and confirm block count of the percentage of transactions in that bucket that were confirmed within that number of blocks.

-Eliminate txs which didn't have all inputs available at entry from fee/pri calcs

-Add dynamic breakpoints and tracking of confirmation delays in mempool transactions

-Remove old CMinerPolicyEstimator and CBlockAverage code

-New smartfees.py

-Pass a flag to the estimation code, using IsInitialBlockDownload as a proxy for when we are still catching up and we shouldn't be counting how many blocks it takes for transactions to be included.

-Add a policyestimator unit test
2015-05-13 10:36:24 -04:00
Tom Harding 5d34e16d3a Add txn_clone.py test
Does what the old txnmall.sh test did.

Creates an equivalent malleated clone and tests that SyncMetaData
syncs the accounting effects from the original transaction to the
confirmed clone.
2015-05-11 17:09:14 -07:00
Wladimir J. van der Laan c1409d11ad
Merge pull request #6073
a681663 clarify that there are only two nodes (Jameson Lopp)
2015-05-11 13:41:03 +02:00
Wladimir J. van der Laan 9ef00c363d
Merge pull request #5958
231072f [QA] add multisig rpc tests (Jonas Schnelli)
2015-05-07 13:18:43 +02:00
Jonas Schnelli 231072fe7b [QA] add multisig rpc tests 2015-05-07 11:05:23 +02:00
Wladimir J. van der Laan 1fd2d39529
Merge pull request #5420
6b4feb8 [QA] rest.py RPC test: change setgenerate() to generate() (Jonas Schnelli)
97ee866 [REST] getutxos REST command (based on Bip64) (Jonas Schnelli)
2015-05-06 16:50:05 +02:00
dexX7 a71ab10f99
QA: add RPC tests for error reporting of "signrawtransaction"
Tests error reporting of transaction signing via RPC call "signrawtransaction".

Expected results:

Test 1: create and sign a valid raw transaction with one input:
- 1) The transaction has a complete set of signatures
- 2) No script verification error occurred

Test 2: create and sign a raw transaction with one valid, one invalid and one missing input script:
- 3) The transaction has no complete set of signatures
- 4) Two script verification errors occurred
- 5) Script verification errors have certain properties ("txid", "vout", "scriptSig", "sequence", "error")
- 6) The verification errors refer to the invalid (vin 1) and missing input (vin 2)
2015-05-05 10:09:39 +02:00
Wladimir J. van der Laan 16341cc15c
Merge pull request #5418
bba2216 RPC test for "#5418 Report missing inputs in sendrawtransaction" (Jonas Schnelli)
de8e801 Report missing inputs in sendrawtransaction (Pieter Wuille)
2015-05-04 12:42:26 +02:00
Wladimir J. van der Laan 00e76db8c2
Merge pull request #6085
b05a89b Non-grammatical language improvements (Luke Dashjr)
7e6d23b Bugfix: Grammar fixes (Corinne Dashjr)
2015-05-04 08:01:58 +02:00
Suhas Daftuar 2a22d4be9b Fix comptool send_message call when MAX_INV_SZ reached 2015-05-01 15:32:24 -04:00
Suhas Daftuar 574db4816f Fix potential race conditions in p2p testing framework
Previously, each NodeConnCB had its own lock to synchronize data structures
used by the testing thread and the networking thread, and NodeConn provided a
separate additional lock for synchronizing access to each send buffer.  This
commit replaces those locks with a single global lock (mininode_lock) that we
use to synchronize access to all data structures shared by the two threads.

Updates comptool and maxblocksinflight to use the new synchronization
semantics, eliminating previous race conditions within comptool, and re-enables
invalidblockrequest.py in travis.
2015-05-01 15:32:24 -04:00
Jonas Schnelli bba2216fc1 RPC test for "#5418 Report missing inputs in sendrawtransaction" 2015-05-01 15:30:10 +02:00
Corinne Dashjr 7e6d23b171 Bugfix: Grammar fixes 2015-05-01 11:21:27 +00:00
Suhas Daftuar ef3281750d Fix mininode disconnections to work with select 2015-04-30 16:40:22 -04:00
Wladimir J. van der Laan da38dc696c
Merge pull request #5981
2703412 Fix default binary in p2p tests to use environment variable (Suhas Daftuar)
29bff0e Add some travis debugging for python scripts (Suhas Daftuar)
d76412b Add script manipulation tools for use in mininode testing framework (Suhas Daftuar)
b93974c Add comparison tool test runner, built on mininode (Suhas Daftuar)
6c1d1ba Python p2p testing framework (Suhas Daftuar)
2015-04-30 14:49:24 +02:00
Suhas Daftuar 2703412a39 Fix default binary in p2p tests to use environment variable 2015-04-29 09:18:33 -04:00
Wladimir J. van der Laan e08886d8a3
Merge pull request #6032
688da79 QA: add --noshutdown option to prevent stopping nodes (dexX7)
2eadeb2 QA: stop nodes after RPC tests, even with --nocleanup (dexX7)
2015-04-29 10:04:33 +02:00
Suhas Daftuar 29bff0e684 Add some travis debugging for python scripts
Adds printing to the console before/after calls to bitcoin-cli -rpcwait,
if the PYTHON_DEBUG environment variable is initialized.
2015-04-28 16:51:46 -04:00
Suhas Daftuar d76412b068 Add script manipulation tools for use in mininode testing framework
script.py is modified from the code in python-bitcoinlib, and provides tools
for manipulating and creating CScript objects.

bignum.py is a dependency for script.py

script_test.py is an example test that uses the script tools for running a test
that compares the behavior of two nodes, in a comptool- style test, for each of
the test cases in the bitcoin unit test script files, script_valid.json and
script_invalid.json.  (This test is very slow to run, but is a proof of concept
for how we can write tests to compare consensus-critical behavior between
different versions of bitcoind.)

bipdersig-p2p.py is another example test in the comptool framework, which tests
deployment of BIP DERSIG for a single node.  It uses the script.py tools for
manipulating signatures to be non-DER compliant.
2015-04-28 15:09:29 -04:00
Suhas Daftuar b93974c3f3 Add comparison tool test runner, built on mininode
comptool.py creates a tool for running a test suite on top of the mininode p2p
framework.  It supports two types of tests: those for which we expect certain
behavior (acceptance or rejection of a block or transaction) and those for
which we are just comparing that the behavior of 2 or more nodes is the same.

blockstore.py defines BlockStore and TxStore, which provide db-backed maps
between block/tx hashes and the corresponding block or tx.

blocktools.py defines utility functions for creating and manipulating blocks
and transactions.

invalidblockrequest.py is an example test in the comptool framework, which
tests the behavior of a single node when sent two different types of invalid
blocks (a block with a duplicated transaction and a block with a bad coinbase
value).
2015-04-28 12:40:56 -04:00
Suhas Daftuar 6c1d1ba6fc Python p2p testing framework
mininode.py provides a framework for connecting to a bitcoin node over the p2p
network. NodeConn is the main object that manages connectivity to a node and
provides callbacks; the interface for those callbacks is defined by NodeConnCB.
Defined also are all data structures from bitcoin core that pass on the network
(CBlock, CTransaction, etc), along with de-/serialization functions.

maxblocksinflight.py is an example test using this framework that tests whether
a node is limiting the maximum number of in-flight block requests.

This also adds support to util.py for specifying the binary to use when
starting nodes (for tests that compare the behavior of different bitcoind
versions), and adds maxblocksinflight.py to the pull tester.
2015-04-28 12:38:29 -04:00
Wladimir J. van der Laan 6364408122
Merge pull request #5199
1ec900a Remove broken+useless lock/unlock log prints (Matt Corallo)
352ed22 Add merkle blocks test (Matt Corallo)
59ed61b Add RPC call to generate and verify merkle blocks (Matt Corallo)
30da90d Add CMerkleBlock constructor for tx set + block and an empty one (Matt Corallo)
2015-04-28 10:07:25 +02:00
Jameson Lopp a681663e28 clarify that there are only two nodes 2015-04-27 20:22:06 -04:00
Wladimir J. van der Laan 585b5dba74
Merge pull request #6036
f89b092 add rpc test for listunspents support for zero value txouts (Jonas Schnelli)
219953c Show zero value txouts in listunspent. (Gregory Maxwell)
2015-04-24 14:57:43 +02:00
Matt Corallo 352ed22c2c Add merkle blocks test 2015-04-23 21:19:15 -07:00
dexX7 688da79e4a
QA: add --noshutdown option to prevent stopping nodes
With `--noshutdown`, the nodes are not stopped explicitly. `--noshutdown` implies `--nocleanup`, to prevent removing datadirs, which are still in use.
2015-04-23 14:19:00 +02:00
mrbandrews f9ec3f0fad Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:

- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
  reasonably be met, with some assumptions about block sizes, orphan rates,
  etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
  mainnet; defined separately for mainnet, testnet, and regtest in chainparams
  as nPruneAfterHeight).

This unsets NODE_NETWORK if pruning is enabled.

Also included is an RPC test for pruning (pruning.py).

Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-04-22 15:53:48 -04:00
Jonas Schnelli 6b4feb89a8 [QA] rest.py RPC test: change setgenerate() to generate() 2015-04-21 20:33:02 +02:00
Jonas Schnelli 97ee866549 [REST] getutxos REST command (based on Bip64)
has parts of @mhearn #4351
* allows querying the utxos over REST
* same binary input and outputs as mentioned in Bip64
* input format = output format
* various rpc/rest regtests
2015-04-21 20:26:49 +02:00
Jonas Schnelli f89b092d75 add rpc test for listunspents support for zero value txouts 2015-04-21 02:25:35 -07:00
Wladimir J. van der Laan 6be3562e50 rpc-tests: Add proxy test
Add test for -proxy, -onion and -proxyrandomize.
2015-04-20 15:04:33 +02:00
dexX7 2eadeb27ed
QA: stop nodes after RPC tests, even with --nocleanup
`--nocleanup` should provide a way to preserve test data, but should not have an impact on whether nodes are to be stopped after the test execution.

In particular, when currently running RPC tests with `--nocleanup`, then it may result in several active `bitcoind` processes, which are not terminated properly.
2015-04-20 13:09:29 +02:00
mrbandrews 0421c18f3a Fix CheckBlockIndex for reindex.
Some tests in CheckBlockIndex require chainActive.Tip(), but when reindexing, chainActive has not been set on the first call to CheckBlockIndex.

reindex.py starts a node, mines 3 blocks, stops, and reindexes with CheckBlockIndex enabled.
2015-04-14 14:10:19 -04:00
Tom Harding defd2d55b7 Better txn_doublespend.py test
Remove reliance on accounting "move" ledger entries.  Instead,
create funding transactions (and deal with fee complexities).

Do not rely on broken SyncMetaData.  Instead expect double-spend
amount to be debited from the default "" account.
2015-04-11 19:05:54 -07:00
Wladimir J. van der Laan 4ac79f99b0
Fix travis after merging #5957
New wallet tests have been added in the meantime and need to be updated
to use `generate` instead of `setgenerate`.
2015-04-09 17:36:10 +02:00
Wladimir J. van der Laan 57026a29bc
Merge pull request #5957
e2edf95 Bugfix: make CreateNewBlock return pindexPrev (Pieter Wuille)
6b04508 Introduce separate 'generate' RPC call (Pieter Wuille)
0df67f1 Simplify hash loop code (Pieter Wuille)
2015-04-09 15:23:09 +02:00
Pieter Wuille 6b04508e37 Introduce separate 'generate' RPC call 2015-04-01 11:47:10 -07:00
Jonas Schnelli 77650cc9f4 add -walletbroadcast=0 rpc test 2015-04-01 13:03:39 +02:00
Gavin Andresen 0f5954c434
Regression test for ResendWalletTransactions
Adds a regression test for the wallet's ResendWalletTransactions function, which uses a new, hidden RPC command "resendwallettransactions."

I refactored main's Broadcast signal so it is passed the best-block time, which let me remove a global variable shared between main.cpp and the wallet (nTimeBestReceived).

I also manually tested the "rebroadcast unconfirmed every half hour or so" functionality by:

1. Running bitcoind -connect=0.0.0.0:8333
2. Creating a couple of send-to-self transactions
3. Connect to a peer using -addnode
4. Waited a while, monitoring debug.log, until I see:
```2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactions```

One last change: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.
2015-03-24 15:29:20 -04:00
Wladimir J. van der Laan 22cfe23196
Merge pull request #5890
cd3d67c Fix InvalidateBlock to add chainActive.Tip to setBlockIndexCandidates (Alex Morcos)
2015-03-24 14:50:54 +01:00
Wladimir J. van der Laan df5c246ba3
Merge pull request #5831
1d9b378 qa/rpc-tests/wallet: Tests for sendmany (Luke Dashjr)
40a7573 rpcwallet/sendmany: Just take an array of addresses to subtract fees from, rather than an Object with all values being identical (Luke Dashjr)
292623a Subtract fee from amount (Cozz Lovan)
90a43c1 [Qt] Code-movement-only: Format confirmation message in sendcoinsdialog (Cozz Lovan)
2015-03-16 12:23:14 +01:00
Alex Morcos cd3d67cf3b Fix InvalidateBlock to add chainActive.Tip to setBlockIndexCandidates 2015-03-13 13:11:11 -04:00
Luke Dashjr 1d9b378c30 qa/rpc-tests/wallet: Tests for sendmany 2015-03-13 11:04:25 +01:00
Cozz Lovan 292623adf5 Subtract fee from amount
Fixes #2724 and #1570.

Adds the
automatically-subtract-the-fee-from-the-amount-and-send-whats-left
feature to the GUI and RPC (sendtoaddress,sendmany).
2015-03-13 11:04:18 +01:00
Alex Morcos 88f6c8c365 add RPC test for InvalidateBlock 2015-03-12 10:15:33 -04:00
Wladimir J. van der Laan d48ce48093
Merge #5548: [REST] add /rest/chaininfos
2c0f901 [REST] rest/chaininfos add documentation (Jonas Schnelli)
59582c8 [REST] add /rest/chaininfos (Jonas Schnelli)
2015-02-10 12:08:07 +01:00
Suhas Daftuar 1cb2a00cb8 Fix getblocktemplate_proposals test by mining one block
This triggers the tested node to no longer be in initial
download, allowing the call to getblocktemplate() to succeed.
2015-02-04 12:04:49 -05:00
Wladimir J. van der Laan 41e6e4caba
Merge pull request #5713
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-03 10:34:53 +01:00
Pieter Wuille 819bcf9b99 Add RPC test for DERSIG BIP switchover logic 2015-02-01 17:51:24 -04:00
bikinibabe ee932025c1 Changed pronouns for correctness and inclusivity 2015-01-31 17:38:28 -05:00
Matt Bogosian 34c61813a4 Fix README link from util.sh -> util.py. 2015-01-31 17:38:28 -05:00
Jonas Schnelli 1a25a7edf8 [QA] fix httpbasic keep-alive test 2015-01-17 08:56:55 -08:00
Jonas Schnelli 1dd8ee72af improve tests for #5655 2015-01-14 09:50:00 -08:00
Wladimir J. van der Laan 56c1093dae fix tests for #5655 2015-01-14 09:50:00 -08:00
Wladimir J. van der Laan e3f5727590
Merge pull request #5612
84d9199 [QA] fix zapwallettxes test (Jonas Schnelli)
2015-01-08 11:51:51 +01:00
Jonas Schnelli 84d919974b [QA] fix zapwallettxes test
- remove shell test script and add a python equivalent
2015-01-07 16:41:12 +01:00
Suhas Daftuar 1eb1e65f09 Fix smartfees test for change to relay policy 2015-01-07 10:11:23 -05:00
Jonas Schnelli 59582c8b8d [REST] add /rest/chaininfos 2014-12-29 20:19:48 +01:00
Jonas Schnelli 12d927a391 RPC test for immature balance 2014-12-25 20:15:10 -08:00
Wladimir J. van der Laan 111a7d45f1
Merge pull request #5470
78253fc Remove references to X11 licence (Michael Ford)
2014-12-19 19:23:23 +01:00
Jonas Schnelli 7a3b83269e [QA] fix httpbasics RPC test typo 2014-12-17 22:40:20 +01:00
Michael Ford 78253fcbad Remove references to X11 licence 2014-12-16 15:56:50 +08:00