Commit Graph

486 Commits

Author SHA1 Message Date
John Newbery 36b6268670 [tests] TestNode: separate add_node from start_node
Separates the act of creating a TestNode object from starting the node.
The test_framework now keeps track of its list of TestNodes, and test
writers can call start_node() and stop_node() without having to update
the self.nodes list.
2017-09-01 12:25:54 -04:00
John Newbery be2a2ab6a6 [tests] fix - use rpc_timeout as rpc timeout 2017-09-01 12:25:50 -04:00
Suhas Daftuar 617c459c6c qa: rpc test for wtxid in mempool entry 2017-08-31 13:18:35 -04:00
MarcoFalke a90e6d2bff
Merge #11150: [tests] Add getmininginfo test
4f2905b76 Add getmininginfo functional test (Cristian Mircea Messel)

Pull request description:

  Add `getmininginfo` functional test in `mining.py`

Tree-SHA512: 12be9cfb37e9ac4c6625fc06051704c8a8dfd7271c2654f994c7659c8810e4b7a4335105ae159315308bcd45b65589bab1829bd134d2f4cabf74d63f2e5d22fe
2017-08-29 10:37:11 +02:00
MarcoFalke 91e49c51f1
Merge #10859: RPC: gettxout: Slightly improve doc and tests
6d2d2eb49 RPC: gettxout: Slightly improve doc and tests (Jorge Timón)

Pull request description:

  Slightly related to https://github.com/bitcoin/bitcoin/pull/10822 in the sense that I felt the documentation and testing wasn't as good as it could be while writing it.

  Ping @sipa since we discussed this on IRC.

Tree-SHA512: a0b3ffdac65245a0429e772fc2d8bcc1e829b02c70fb2af6ee0b7578cae46683f6c51a824b4d703d4dc3f99b6f03a658d6bbc818bf32981516f24124249a211d
2017-08-28 15:45:45 -08:00
Jorge Timón 6d2d2eb493
RPC: gettxout: Slightly improve doc and tests 2017-08-29 00:57:28 +02:00
Cristian Mircea Messel 4f2905b76b Add getmininginfo functional test 2017-08-28 19:08:39 +03:00
practicalswift 78214588d6 Use for-loop instead of list comprehension
To make it clear that we are intentionally using it for its
side-effects.
2017-08-28 15:18:14 +02:00
practicalswift 8239794360 Use the variable name _ for unused return values 2017-08-28 15:18:14 +02:00
practicalswift 2e6080bbf3 Remove unused variables and/or function calls 2017-08-28 15:18:14 +02:00
Akio Nakamura 07704c1b37 Add some tests for getchaintxstats
1. Add a test for no parameters.
2. Add a test for the block's height = 1.
3. Add a test for nblocks is out of range.
2017-08-25 18:32:45 +09:00
John Newbery 0063d2c3dc [tests] Make p2p-leaktests.py more robust 2017-08-24 17:28:13 -04:00
MarcoFalke 4ae6d0fbef
Merge #10798: [tests] [utils] test bitcoin-cli
c6ec4358a [tests] Add bitcoin_cli.py test script (John Newbery)
b23549f6e [tests] add TestNodeCLI class for calling bitcoin-cli for a node (John Newbery)

Pull request description:

  We don't test bitcoin-cli at all. That means that we can miss inconsistencies between the bitcoin-cli client and the RPC interface, such as #10698 and #10747. It also means that the various bitcoin-cli options and features are untested and regressions could be silently introduced.

  Let's fix that.

  This PR adds bitcoin-cli testing in the python functional test_framework:

  1. Add a bitcoin_cli.py test script that tests bitcoin-cli. At the moment it only tests that the result of `getinfo` is the same if you run it as an RPC or through bitcoin-cli, but can easily be extended to test additional bitcoin-cli features

  **EDIT: `--usecli` option is moved to a separate PR. This PR now only covers the bitcoin_cli.py test.**

  2. ~Add a `--usecli` option to the test framework. This changes the test to use bitcoin-cli for all RPC calls instead of using direct HTTP requests. This is somewhat experimental. It works for most tests, but there are some cases where it can't work transparently because:~
  - ~the testcase is asserting on a specific error code, and bitcoin-cli returns a different error code from the direct RPC~
  - ~we're sending a very large RPC request (eg `submitblock`) and it can't be serialized into a shell bitcoin-cli call.~

  ~I think that even though `--usecli` doesn't work on all tests, it's still a useful experimental feature. Future potential enhancements:~
  - ~enhance the framework to automatically skip tests that are known to fail with bitcoin-cli if the `--usecli` option is used.~
  - ~run a subset of tests in Travis with `-usecli`~

  This builds on and requires the `TestNode` PR #10711 . As an aside, this is a good demonstration of how tidy it is to add additional features/interfaces now that test node logic/state is encapsulated in a TestNode class.

  Addresses #10791

Tree-SHA512: a1e6be12e8e007f6f67b3d3bbcd142d835787300831eb38e6027a1ad25ca9d79c4bc99a41b19e31ee95205cba1b3b2d21a688b5909316aad70bfc2b4eb6d8a52
2017-08-24 16:04:36 -04:00
MarcoFalke 8858b6ddd3
Merge #11068: qa: Move wait_until to util
08ce33f8e qa: Move wait_until to util (MarcoFalke)

Pull request description:

  This moves `wait_until` to `util.py` to make it generally available to python tests.
  Also, `wait_until` now takes an optional lock that is acquired while testing the predicate.
  Previously the lock was always acquired, even when it was not necessary, cf. `disconnect_ban.py`.

Tree-SHA512: 18e452a017a6566fa8ad09bde058e1b841e167039dc63299e70cfa7a6dcbc779581e60ca3e8eb2f1b610767d5208b9376c203eb11015b250fd0542b5eb4215a8
2017-08-23 17:12:30 -04:00
John Newbery 2b4ea520b7 [tests] fix timeout issues from TestNode
Fixes a couple of bugs from the introduction of TestNode:

- test scripts were no longer able to specify a custom timeout for
starting a node. Therefore tests with nodes that take a long time to
start up (eg pruning.py) would fail.
- the test for whether a node has failed on start up was broken
by changing 'assert x is None' to 'assert not x'. Since
subprocess.poll() can return None (indicating the node is still running)
or 0 (indicating the node exited with return code 0), this was a
regression.
2017-08-23 10:56:31 -04:00
Wladimir J. van der Laan c1470a058f test: Increase initial RPC timeout to 60 seconds
When running the tests locally with a parallelism of 4 on an otherwise
busy system, RPC can take quite a wait to come up.

Change the timeout to 60 seconds just to be safe.
2017-08-20 15:02:51 +02:00
Wladimir J. van der Laan 262167393d
Merge #10952: [wallet] Remove vchDefaultKey and have better first run detection
e53615b Remove vchDefaultKey and have better first run detection (Andrew Chow)

Pull request description:

  Removes vchDefaultKey which was only used for first run detection. Improves wallet first run detection by checking to see if any keys were read from the database.

  This also fixes a (rather contrived) case where an encrypted non-HD wallet has corruption such that the default key is no longer valid and is loaded into a Core version that supports HD wallets. This causes a runtime exception since a new hd master key is generated as the software believes the wallet file is newly created but cannot add the generated key to the wallet since it is encrypted. I was only able to replicate this error by creating a non-hd wallet, encrypting it, then editing the wallet using `db_dump` and `db_load` before loading the wallet with hd enabled. This problem has been reported by [two](https://bitcointalk.org/index.php?topic=1993244.0) [users](https://bitcointalk.org/index.php?topic=1746976.msg17511261#msg17511261) so it is something that can happen, although that raises the question of "what corrupted the default key".

  ~P.S. I don't know what's up with the whitespace changes. I think my text editor is doing something stupid but I don't think those are important enough to attempt undoing them.~ Undid those

Tree-SHA512: 63b485f356566e8ffa033ad9b7101f7f6b56372b29ec2a43b947b0eeb1ada4c2cfe24740515d013aedd5f51aa1890dfbe499d2c5c062fc1b5d272324728a7d55
2017-08-18 18:56:49 +02:00
MarcoFalke 08ce33f8e9 qa: Move wait_until to util 2017-08-17 15:17:09 +02:00
MarcoFalke 6366941275
Merge #10680: Fix inconsistencies and grammar in various files
1d8df0141 Fix MD formatting in REST-interface.md and spelling mistake in test_runner.py (MeshCollider)
41f3e84aa Fix inconsistencies and grammar in various files (MeshCollider)

Pull request description:

  Just a simple fix of some inconsistent capitalization, formatting and grammar in a few files (no code changes)

Tree-SHA512: 60b12a5a5c69a1af4a25b7db0b32ed806ed62ad2966cee08b3792a7cfa7f51848fd485349b4c09e60a7eedfdf55ee730c51daa066d6e226ae404c93342bf3e13
2017-08-16 00:46:40 +02:00
MarcoFalke 4fb2586661
Merge #10956: Fix typos
9d5e98ff8 Fix typos. (practicalswift)

Pull request description:

  Fix some typos not covered by #10705.

Tree-SHA512: f06e9541f6ae13ef5d6731399b61795997b21a8816abeb1749c93e99a5c47354e6cbd4a3d145f4dc6ef8a13db179799a3121ecbb7288abf3e8d81cdf81500d37
2017-08-16 00:37:18 +02:00
MarcoFalke d7be7b39fa
Merge #10705: Trivial: spelling fixes
f42fc1d50 doc: spelling fixes (klemens)

Pull request description:

  patch contains some spelling fixes ( just in comments ) as found by a bot ( http://www.misfix.org, https://github.com/ka7/misspell_fixer ).

Tree-SHA512: ba6046cfcd81b0783420daae7d776be92dd7b85a593e212f8f1b4403aca9b1b6af12cef7080d4ea5ed4a14952fd25e4300109a59c414e08f5395cdb9947bb750
2017-08-16 00:30:12 +02:00
klemens f42fc1d508 doc: spelling fixes 2017-08-16 00:24:39 +02:00
Andrew Chow e53615b443 Remove vchDefaultKey and have better first run detection
Removes vchDefaultKey which was only used for first run detection.
Improves wallet first run detection by checking to see if any keys
were read from the database.

This will now also check for a valid defaultkey for backwards
compatibility reasons and to check for any corruption.

Keys will stil be generated on the first one, but there won't be
any shown in the address book as was previously done.
2017-08-15 15:05:53 -07:00
John Newbery c6ec4358a7 [tests] Add bitcoin_cli.py test script 2017-08-15 17:52:56 -04:00
John Newbery b23549f6e6 [tests] add TestNodeCLI class for calling bitcoin-cli for a node 2017-08-15 17:52:51 -04:00
MarcoFalke 85aec87b11
Merge #10711: [tests] Introduce TestNode
789733891 [tests] Introduce TestNode (John Newbery)

Pull request description:

  Continues #10082

  TestNode is a class responsible for all state related to a bitcoind node
  under test. It stores local state, is responsible for tracking the
  bitcoind process and delegates unrecognised messages to the RPC
  connection.

  This commit changes start_nodes and stop_nodes to start and stop the
  bitcoind nodes in parallel, making test setup and teardown much faster.

  On my vm, this changeset reduces total test_runner runtime for the base set of tests
  (including building the cache) from 263s to 195s (a 25% speedup). Note that the time
  reported by test_runner does not include time spent building the cache:

  *with TestNode*:
  ```
  → date +"%T" ; ./test_runner.py -q ; date +"%T"
  12:48:04
  ..................................................................................................................................................................................................................................................................................................................................
  TEST                           | STATUS    | DURATION

  abandonconflict.py             | ✓ Passed  | 12 s
  bip68-112-113-p2p.py           | ✓ Passed  | 19 s
  blockchain.py                  | ✓ Passed  | 8 s
  bumpfee.py                     | ✓ Passed  | 13 s
  decodescript.py                | ✓ Passed  | 3 s
  disablewallet.py               | ✓ Passed  | 3 s
  disconnect_ban.py              | ✓ Passed  | 6 s
  fundrawtransaction.py          | ✓ Passed  | 37 s
  getchaintips.py                | ✓ Passed  | 4 s
  httpbasics.py                  | ✓ Passed  | 3 s
  import-rescan.py               | ✓ Passed  | 4 s
  importmulti.py                 | ✓ Passed  | 6 s
  importprunedfunds.py           | ✓ Passed  | 3 s
  invalidblockrequest.py         | ✓ Passed  | 4 s
  invalidtxrequest.py            | ✓ Passed  | 4 s
  keypool.py                     | ✓ Passed  | 7 s
  listsinceblock.py              | ✓ Passed  | 4 s
  listtransactions.py            | ✓ Passed  | 33 s
  mempool_limit.py               | ✓ Passed  | 4 s
  mempool_persist.py             | ✓ Passed  | 15 s
  mempool_reorg.py               | ✓ Passed  | 4 s
  mempool_resurrect_test.py      | ✓ Passed  | 3 s
  mempool_spendcoinbase.py       | ✓ Passed  | 3 s
  merkle_blocks.py               | ✓ Passed  | 3 s
  multi_rpc.py                   | ✓ Passed  | 4 s
  net.py                         | ✓ Passed  | 3 s
  nulldummy.py                   | ✓ Passed  | 3 s
  p2p-compactblocks.py           | ✓ Passed  | 28 s
  p2p-fullblocktest.py           | ✓ Passed  | 126 s
  p2p-leaktests.py               | ✓ Passed  | 8 s
  p2p-mempool.py                 | ✓ Passed  | 3 s
  p2p-segwit.py                  | ✓ Passed  | 59 s
  p2p-versionbits-warning.py     | ✓ Passed  | 8 s
  preciousblock.py               | ✓ Passed  | 3 s
  prioritise_transaction.py      | ✓ Passed  | 5 s
  proxy_test.py                  | ✓ Passed  | 3 s
  rawtransactions.py             | ✓ Passed  | 9 s
  receivedby.py                  | ✓ Passed  | 19 s
  reindex.py                     | ✓ Passed  | 12 s
  rest.py                        | ✓ Passed  | 9 s
  rpcnamedargs.py                | ✓ Passed  | 3 s
  segwit.py                      | ✓ Passed  | 7 s
  sendheaders.py                 | ✓ Passed  | 24 s
  signmessages.py                | ✓ Passed  | 3 s
  signrawtransactions.py         | ✓ Passed  | 3 s
  txn_clone.py                   | ✓ Passed  | 4 s
  txn_doublespend.py --mineblock | ✓ Passed  | 4 s
  uptime.py                      | ✓ Passed  | 3 s
  wallet-accounts.py             | ✓ Passed  | 3 s
  wallet-dump.py                 | ✓ Passed  | 7 s
  wallet-encryption.py           | ✓ Passed  | 8 s
  wallet-hd.py                   | ✓ Passed  | 15 s
  wallet.py                      | ✓ Passed  | 31 s
  walletbackup.py                | ✓ Passed  | 104 s
  zapwallettxes.py               | ✓ Passed  | 9 s
  zmq_test.py                    | ○ Skipped | 0 s

  ALL                            | ✓ Passed  | 735 s (accumulated)
  Runtime: 189 s

  12:51:19
  ```

  *master*:
  ```
  → date +"%T" ; ./test_runner.py -q ; date +"%T"
  12:40:13
  ..........................................................................................................................................................................................................................................................................................................................................................................................................................................
  TEST                           | STATUS    | DURATION

  abandonconflict.py             | ✓ Passed  | 15 s
  bip68-112-113-p2p.py           | ✓ Passed  | 19 s
  blockchain.py                  | ✓ Passed  | 8 s
  bumpfee.py                     | ✓ Passed  | 20 s
  decodescript.py                | ✓ Passed  | 3 s
  disablewallet.py               | ✓ Passed  | 3 s
  disconnect_ban.py              | ✓ Passed  | 8 s
  fundrawtransaction.py          | ✓ Passed  | 36 s
  getchaintips.py                | ✓ Passed  | 11 s
  httpbasics.py                  | ✓ Passed  | 7 s
  import-rescan.py               | ✓ Passed  | 16 s
  importmulti.py                 | ✓ Passed  | 10 s
  importprunedfunds.py           | ✓ Passed  | 5 s
  invalidblockrequest.py         | ✓ Passed  | 4 s
  invalidtxrequest.py            | ✓ Passed  | 3 s
  keypool.py                     | ✓ Passed  | 7 s
  listsinceblock.py              | ✓ Passed  | 11 s
  listtransactions.py            | ✓ Passed  | 37 s
  mempool_limit.py               | ✓ Passed  | 4 s
  mempool_persist.py             | ✓ Passed  | 23 s
  mempool_reorg.py               | ✓ Passed  | 7 s
  mempool_resurrect_test.py      | ✓ Passed  | 3 s
  mempool_spendcoinbase.py       | ✓ Passed  | 3 s
  merkle_blocks.py               | ✓ Passed  | 10 s
  multi_rpc.py                   | ✓ Passed  | 6 s
  net.py                         | ✓ Passed  | 6 s
  nulldummy.py                   | ✓ Passed  | 3 s
  p2p-compactblocks.py           | ✓ Passed  | 30 s
  p2p-fullblocktest.py           | ✓ Passed  | 126 s
  p2p-leaktests.py               | ✓ Passed  | 8 s
  p2p-mempool.py                 | ✓ Passed  | 3 s
  p2p-segwit.py                  | ✓ Passed  | 62 s
  p2p-versionbits-warning.py     | ✓ Passed  | 8 s
  preciousblock.py               | ✓ Passed  | 8 s
  prioritise_transaction.py      | ✓ Passed  | 7 s
  proxy_test.py                  | ✓ Passed  | 10 s
  rawtransactions.py             | ✓ Passed  | 15 s
  receivedby.py                  | ✓ Passed  | 28 s
  reindex.py                     | ✓ Passed  | 12 s
  rest.py                        | ✓ Passed  | 12 s
  rpcnamedargs.py                | ✓ Passed  | 3 s
  segwit.py                      | ✓ Passed  | 12 s
  sendheaders.py                 | ✓ Passed  | 26 s
  signmessages.py                | ✓ Passed  | 3 s
  signrawtransactions.py         | ✓ Passed  | 3 s
  txn_clone.py                   | ✓ Passed  | 10 s
  txn_doublespend.py --mineblock | ✓ Passed  | 10 s
  uptime.py                      | ✓ Passed  | 3 s
  wallet-accounts.py             | ✓ Passed  | 3 s
  wallet-dump.py                 | ✓ Passed  | 6 s
  wallet-encryption.py           | ✓ Passed  | 8 s
  wallet-hd.py                   | ✓ Passed  | 18 s
  wallet.py                      | ✓ Passed  | 69 s
  walletbackup.py                | ✓ Passed  | 130 s
  zapwallettxes.py               | ✓ Passed  | 15 s
  zmq_test.py                    | ○ Skipped | 0 s

  ALL                            | ✓ Passed  | 936 s (accumulated)
  Runtime: 242 s

  12:44:36
  ```

Tree-SHA512: 6dfc4c11fd0caf7de6954c93679cf22c3df0acc6f432e616d1151062a61f456faa8ae2fe670b427868af55bb564802df84c8fd76e90b4b338750dbc23f46ad88
2017-08-15 23:35:07 +02:00
John Newbery 7897338918 [tests] Introduce TestNode
TestNode is a class responsible for all state related to a bitcoind node
under test. It stores local state, is responsible for tracking the
bitcoind process and delegates unrecognised messages to the RPC
connection.

This commit changes start_nodes and stop_nodes to start and stop the
bitcoind nodes in parallel, making test setup and teardown much faster.
2017-08-15 13:12:15 -04:00
Wladimir J. van der Laan 653a46dd91
Merge #11022: Basic keypool topup
d34957e [wallet] [tests] Add keypool topup functional test (Jonas Schnelli)
095142d [wallet] keypool mark-used and topup (John Newbery)
c25d90f [wallet] Add HasUnusedKeys() helper (John Newbery)
f2123e3 [wallet] Cache keyid -> keypool id mappings (John Newbery)
83f1ec3 [wallet] Don't hold cs_LastBlockFile while calling setBestChain (John Newbery)
2376bfc [wallet] [moveonly] Move LoadKeyPool to cpp (Matt Corallo)
cab8557 [wallet] [moveonly] Move CAffectedKeysVisitor (Jonas Schnelli)

Pull request description:

  This PR contains the first part of #10882 :

  - if a key from the keypool is used, mark all keys up to that key as used, and then try to top up the keypool
  - top up the keypool on startup

  Notably, it does not stop the node or prevent the best block from advancing if the keypool drops below a threshold (which means that transactions may be missed and funds lost if restoring from an old HD wallet backup).

Tree-SHA512: ac681fefeaf7ec2aab2fa1da93d12273ea80bd05eb48d7b3b551ea6e5d975dd97ba7de52b7fba52993823280ac4079cc36cf78a27dac708107ebf8fb6326142b
2017-08-14 16:08:44 +02:00
MarcoFalke aeb3175627
Merge #11032: [qa] Fix block message processing error in sendheaders.py
f1bf31186 [qa] Fix block message processing error in sendheaders.py (Suhas Daftuar)

Pull request description:

  Introduced in #10169

  @jnewbery

Tree-SHA512: f330b926c51bd4f1b63738e1ddac23c58cb32345baed36343f7a989b3b9906c5c6e7dbd74b416f662c6ef68b8d256a6c69a977ec5f85789b2c1dc802bc831f6b
2017-08-12 13:22:35 +02:00
João Barbosa bdf607e438 test: Add resendwallettransactions functional tests 2017-08-12 04:42:45 +01:00
Suhas Daftuar f1bf31186c [qa] Fix block message processing error in sendheaders.py 2017-08-11 21:36:28 -04:00
MarcoFalke bf74d377fb
Merge #11023: [tests] Add option to attach a python debugger if functional test fails
cc5d38f4b Add option to attach a python debugger if test fails (John Newbery)

Pull request description:

  Adds a simple option to the test_framework to attach pdb if the test fails.

  Helpful for catching and debugging intermittent failures: Run the test in a loop with this option. The first failure will cause execution to pause and nodes will be left running for interactive debugging.

  @sdaftuar

Tree-SHA512: 01cfae15fa3f04ed6ec6a99fef60a6c6a59723429309e81eacd6767caf12f5758f59b337804291ecab33a38a2958f36e2b513d201bee72a2eeb207a67046f952
2017-08-11 18:10:30 +02:00
MarcoFalke e5d26e47c7
Merge #11025: qa: Fix inv race in example_test
faa76d1b7 qa: Fix inv race in example_test (MarcoFalke)

Pull request description:

  There have been intermittent test failures on this script.

  ```py
    File "./test/functional/example_test.py", line 216, in run_test
      assert_equal(block, 1)
  AssertionError: not(2 == 1)
  ```

  Probably the simplest way to fix them is overriding the `on_inv` method, so that no "colliding" getdata for the blocks are sent out.

  Additionally, all getdata are now sent in a single message.

Tree-SHA512: 809c2bbfa90a67fc97905769fcbe90ba9abe1aac1f145530934f56a364835973b94d3302b6be68f4f2987acf333bce146bcc4c878c283301871ba5bb1a9bedb6
2017-08-11 16:58:28 +02:00
MarcoFalke faa76d1b79 qa: Fix inv race in example_test 2017-08-10 21:29:48 +02:00
Jonas Schnelli d34957e17e [wallet] [tests] Add keypool topup functional test 2017-08-10 13:50:16 -04:00
John Newbery 095142d1f9 [wallet] keypool mark-used and topup
This commit adds basic keypool mark-used and topup:

- try to topup the keypool on initial load
- if a key in the keypool is used, mark all keys before that as used and
try to top up
2017-08-10 13:44:02 -04:00
John Newbery cc5d38f4b8 Add option to attach a python debugger if test fails 2017-08-10 12:50:51 -04:00
MarcoFalke 4b5a7ce0c3
Merge #11003: Docs: Capitalize bullet points in CONTRIBUTING guide
13b1e9a16 Capitalize bullet points in CONTRIBUTING guide (Evan Klitzke)

Pull request description:

  English grammar dictates that these bullet points should be capitalized.
  This also makes the capitalization style consistent with the rest of the
  document, e.g. the "Decision Making Process" section.

Tree-SHA512: 59f5a8941180ff3862ba63d364c27fd83d2e144299a71b2e784d58f806e8a02d7951dcc80fcc7152d0c78c2d1f5a22db1236af7ea6b9abece8dbe93533e4b65c
2017-08-09 11:17:49 +02:00
MarcoFalke 929fd7276c
Merge #10695: [qa] Rewrite BIP65/BIP66 functional tests
4ccc12a54 [qa] Rewrite BIP66 functional tests (Suhas Daftuar)
d4f0d87b6 [qa] Rewrite BIP65 functional tests (Suhas Daftuar)

Pull request description:

  After 122786d0e0, BIP65 and BIP66 activate at
  particular fixed heights (without regard to version numbers of blocks
  below those heights).  Rewrite the functional tests to take
  this into account, and remove two tests that weren't really testing anything.

  Moves the rewritten functional tests out of the extended test suite, so that they run in travis regularly.

  Note: I discovered that the ComparisonTestFramework (which the original versions of these p2p tests were written is, has a bug that caused them to not catch obvious errors, eg if you just comment out setting the script flags for these softforks in ConnectBlock, the versions of these tests in master do not fail(!) -- will separately PR a fix for the comparison test framework).

Tree-SHA512: 2108b79951f2e980854d0d14ccc0fd1810a43dd4251fd6e3b203e7f104ea55e00650bb1a60a28c2801b4249f46563a8559ac3e3cd39db220914acfed0b3b163d
2017-08-08 23:04:03 +02:00
Evan Klitzke 13b1e9a162 Capitalize bullet points in CONTRIBUTING guide
English grammar dictates that these bullet points should be capitalized.
This also makes the capitalization style consistent with the rest of the
document, e.g. the "Decision Making Process" section.
2017-08-08 13:42:13 -07:00
practicalswift 9d5e98ff80 Fix typos. 2017-08-08 17:12:57 +02:00
John Newbery 5e35cd94c1 [tests] Test disconnecting unsupported service bits logic.
In v0.15, we disconnect nodes that send us version messages with
unsupported service bits (1 << 5 and 1 << 7). This commit adds a test
that bitcoind will disconnect those nodes before August 1st 2018, and won't
disconnect those nodes after August 1st 2018.
2017-08-07 11:37:54 -04:00
Wladimir J. van der Laan f66c596505
Merge #10788: [RPC] Fix addwitnessaddress by replacing ismine with producesignature
e222dc2 Replace ismine with producesignature check in witnessifier (Andrew Chow)

Pull request description:

  Instead of using ismine to check whether an address can be spent by us, make the witness version of the script or address first and then use ProduceSignature with the DummySignatureCreator to check if we can
  solve for the script.

  This is to fix cases where we don't have all of the private keys (for something like a multisig address) but have the redeemscript so we can witnessify it.

Tree-SHA512: 371777aee839cceb41f099109a13689120d35cf3880cde39216596cc2aac5cc1096af7d9cf07ad9306c3b05c073897f4518a7e97f0b88642f1e3b80b799f481e
2017-08-01 14:27:01 +02:00
John Newbery d84e78ec39 [wallet] Specify wallet name in wallet loading errors 2017-07-28 11:25:38 +01:00
João Barbosa a6da027d83 Reject invalid wallet files 2017-07-28 11:23:43 +01:00
João Barbosa 3ef77a0c12 Reject duplicate wallet filenames 2017-07-28 11:23:42 +01:00
Andrew Chow e222dc2aee Replace ismine with producesignature check in witnessifier
Instead of using ismine to check whether an address can be spent by us,
make the witness version of the script or address first and then use
ProduceSignature with the DummySignatureCreator to check if we can
solve for the script.

Also fixes test cases to reflect this change.
2017-07-27 15:04:00 -07:00
Russell Yanofsky e526b3d34c Fix misleading "Method not found" multiwallet errors
Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required
wallet filename was not specified in an RPC call.

Also raise more specific RPC_WALLET_NOT_FOUND error instead of
RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency.
2017-07-26 02:48:15 -04:00
Wladimir J. van der Laan 60f9778abf
Revert "[tests] Allow tests to pass when stderr is non-empty"
This reverts commit d64ac3f4aa after further discussion.

Tree-SHA512: db1e4ff5b17bcd6fd000a3d21aa74f6b7e4c194e0663c1896a100612671910a7cdadd896b59642420ea016598895b54a8468914847ebefef105a3c47c311d4b2
2017-07-25 21:42:36 +02:00
MarcoFalke f1f1605c22
Merge #10703: [tests] Allow tests to pass when stderr is non-empty
d64ac3f [tests] Allow tests to pass when stderr is non-empty (Jonas Schnelli)

Pull request description:

  Resurrect #10241 with nits addressed

  Not sure how much people want this. Would be useful for functional tests which cause bitcoind to print to stderr.

Tree-SHA512: 28caccf7818fb3ed5a38caef7f77161b1678aa9b8fd12c2d1e76032f409f0d33c40f7ac91e0c8d908df4a44fd01cf97d657a08bae50c6ff17d07f5b2e20c3a6e
2017-07-25 21:21:09 +02:00
Wladimir J. van der Laan 6ef3c7ec62
Merge #9622: [rpc] listsinceblock should include lost transactions when parameter is a reorg'd block
876e92b Testing: listsinceblock should display all transactions that were affected since the given block, including transactions that were removed due to a reorg. (Karl-Johan Alm)
f999c46 listsinceblock: optionally find and list any transactions that were undone due to reorg when requesting a non-main chain block in a new 'removed' array. (Karl-Johan Alm)

Pull request description:

  The following scenario will not notify the caller of the fact `tx0` has been dropped:

  1. User 1 receives BTC in tx0 from utxo1 in block aa1.
  2. User 2 receives BTC in tx1 from utxo1 (same) in block bb1
  3. User 1 sees 2 confirmations at block aa3.
  4. Reorg into bb chain.
  5. User 1 asks `listsinceblock aa3` and does not see that tx0 is now invalidated.

  See `listsinceblock.py` commit for related test.

  The proposed fix is to iterate from the given block down to the fork point, and to check each transaction in the blocks against the wallet, in addition to including all transactions from the fork point to the active chain tip (the current behavior). Any transactions that were present will now also be listed in the `listsinceblock` output in a new `replaced` array. This operation may be a bit heavy but the circumstances (and perceived frequency of occurrence) warrant it, I believe.

  Example output:
  ```Python
  {
    'transactions': [],
    'replaced': [
      {
        'walletconflicts': [],
        'vout': 1,
        'account': '',
        'timereceived': 1485234857,
        'time': 1485234857,
        'amount': '1.00000000',
        'bip125-replaceable': 'unknown',
        'trusted': False,
        'category': 'receive',
        'txid': 'ce673859a30dee1d2ebdb3c05f2eea7b1da54baf68f93bb8bfe37c5f09ed22ff',
        'address': 'miqEt4kWp9zSizwGGuUWLAmxEcTW9bFUnQ',
        'label': '',
        'confirmations': -7
      }
    ],
    'lastblock': '7a388f27d09e3699102a4ebf81597d974fc4c72093eeaa02adffbbf7527f6715'
  }
  ```

  I believe this addresses the comment by @luke-jr in https://github.com/bitcoin/bitcoin/pull/9516#issuecomment-274190081 but I could be wrong..

Tree-SHA512: 607b5dcaeccb9dc0d963d3de138c40490f3e923050b29821e6bd513d26beb587bddc748fbb194503fe618cfe34a6ed65d95e8d9c5764a882b6c5f976520cff35
2017-07-24 12:59:48 +02:00
Jonas Schnelli 44eb9d406a
[QA] Avoid running multiwallet.py twice 2017-07-21 15:59:06 +02:00
Karl-Johan Alm 876e92bf54
Testing: listsinceblock should display all transactions that were affected since the given block, including transactions that were removed due to a reorg. 2017-07-21 09:51:00 +09:00
John Newbery 3707fcd94e [wallet] [tests] Add listwallets to multiwallet test 2017-07-20 17:06:29 -04:00
Wladimir J. van der Laan adf170daf9
Merge #10571: [RPC]Move transaction combining from signrawtransaction to new RPC
6b4f231 Move transaction combining from signrawtransaction to new RPC (Andrew Chow)

Pull request description:

  Create a combinerawtransaction RPC which accepts a json array of hex raw transactions to combine them into one transaction. Signrawtransaction is changed to no longer combine transactions and only accept one transaction at a time.

  The tests have been updated to test this. Tests for the signrawtransaction merge have also been removed.

  This is part of #10570

Tree-SHA512: 035aebbd6537c1c017d5c8e06d309228b4c23fe52d5b31ffde19741c81a11a6346ddbbdc582b77b02a47f4c22b1952b69d3c2ee1109c29b3f0f1b612d8de53ed
2017-07-20 16:42:27 +02:00
Andrew Chow 6b4f231f5f Move transaction combining from signrawtransaction to new RPC
Create a combinerawtransaction RPC which accepts a json array of hex raw
transactions to combine them into one transaction. Signrawtransaction is changed
to no longer combine transactions and only accept one transaction at a time.
2017-07-18 10:59:06 -07:00
Wladimir J. van der Laan 9e8d6a3fb4
Merge #10784: Do not allow users to get keys from keypool without reserving them
cf82a9e Do not allow users to get keys from keypool without reserving them (Matt Corallo)

Pull request description:

  fundrawtransaction allows users to add a change output and then
  not have it removed from keypool. While it would be nice to have
  users follow the normal CreateTransaction/CommitTransaction process
  we use internally, there isnt much benefit in exposing this option,
  especially with HD wallets, while there is ample room for users to
  misunderstand or misuse this option.

  This partially reverts #9377. Would be nice to get this for 15 since its kinda crazy we have this option to begin with IMO, will need release notes as an RPC option is now ignored.

Tree-SHA512: 72b5ee9c4a229b84d799dfb00c56fe80d8bba914ce81a433c3f5ab325bf9bf2b839ee658c261734f0ee183ab19435039481014d09c41dbe155e6323e63beb01d
2017-07-18 17:31:06 +02:00
Matt Corallo cf82a9e704 Do not allow users to get keys from keypool without reserving them
fundrawtransaction allows users to add a change output and then
not have it removed from keypool. While it would be nice to have
users follow the normal CreateTransaction/CommitTransaction process
we use internally, there isnt much benefit in exposing this option,
especially with HD wallets, while there is ample room for users to
misunderstand or misuse this option.

This could be particularly nasty in some use-cases (especially
pre-HD-split) - eg a user might fundrawtransaction, then call
getnewaddress, hand out the address for someone to pay them, then
sendrawtransaction. This may result in the user thinking they have
received payment, even though it was really just their own change!

This could obviously result in needless key-reuse.
2017-07-18 11:20:47 -04:00
Jonas Schnelli 6b9faf7470
[QA] add basic multiwallet test 2017-07-17 17:42:22 +02:00
John Newbery 979d0b8a65
[tests] [wallet] Add wallet endpoint support to authproxy 2017-07-17 17:42:21 +02:00
John Newbery e7a2181b49 [wallet] fix zapwallettxes interaction with persistent mempool
zapwallettxes previously did not interact well with persistent mempool.
zapwallettxes would cause wallet transactions to be zapped, but they
would then be reloaded from the mempool on startup. This commit softsets
persistmempool to false if zapwallettxes is enabled so transactions are
actually zapped.
2017-07-15 15:15:25 -04:00
John Newbery ff7365e780 [tests] fix flake8 warnings in zapwallettxes.py 2017-07-15 15:15:25 -04:00
Wladimir J. van der Laan e4f226a133
Merge #10190: [tests] mining functional tests (including regression test for submitblock)
11ba8e9 [tests] rename getblocktemplate_proposals.py to mining.py (John Newbery)
b29dd41 [tests] add test for submit block (John Newbery)
9bf0d80 [tests] run successful test in getblocktemplate first (John Newbery)
82dc597 [tests] don't build blocks manually in getblocktemplate test (John Newbery)
f82c709 [tests] clarify assertions in getblocktemplate test (John Newbery)
66c570a [tests] Don't build the coinbase manually in getblocktemplate test (John Newbery)
38b38cd [tests] getblocktemplate_proposals.py: add logging (John Newbery)
0a3a5ff [tests] Fix flake8 warnings in getblocktemplate tests (John Newbery)
32cffe6 [tests] Fix import order in getblocktemplate test (John Newbery)

Tree-SHA512: a51a57314fa1c4c4b8a7896492ec6e677b6bed12387060def34a62e9dfbee7961f71bb5553fbd70028be61ae32eccf13fd255fa9651f908e9a5e64c28f43f00e
2017-07-11 15:21:26 +02:00
MarcoFalke 1d4805ce04
Merge #10759: Fix multi_rpc test for hosts that dont default to utf8
bc7d103 Fix multi_rpc test for hosts that dont default to utf8 (Matt Corallo)

Tree-SHA512: 7644b1f50d4010a08aed5d1c87ab7326af9c109ac05dfbfc4bb6d5a19ace7997ef9cdd64d4301072f1106225de6d3aacccb17f53043b55ba61f5723c2b65af30
2017-07-07 13:28:47 +02:00
John Newbery 301fd51b9e [tests] fix replace_by_fee.py
fb915d5b18 changed the optIntoRbf field in
fundrawtransaction to replaceable. This commit fixes up
replace-by-fee.py to use the new option name.
2017-07-07 08:41:31 +01:00
Matt Corallo bc7d1032f8 Fix multi_rpc test for hosts that dont default to utf8
Otherwise the utf8 written to bitcoin.conf throws an exception when
read from get_auth_cookie
2017-07-06 22:04:46 -04:00
Suhas Daftuar 4ccc12a54a [qa] Rewrite BIP66 functional tests
Rewrite the BIP66 functional tests to reflect height-based activation,
and move it out of the extended test suite.

Remove the unnecessary bipdersig.py test
2017-07-06 10:09:54 -04:00
John Newbery 27c63dc059 [tests] nits in dbcrash.py 2017-07-02 21:55:13 +01:00
MeshCollider 1d8df01412 Fix MD formatting in REST-interface.md and spelling mistake in
test_runner.py
2017-07-01 20:29:00 +12:00
Suhas Daftuar d4f0d87b6f [qa] Rewrite BIP65 functional tests
After 122786d0e0, BIP65 activates at
a particular height (without regard to version numbers of blocks
below that height).  Rewrite the BIP65 functional tests to take
this into account, and add a test case that exercises
OP_CHECKLOCKTIMEVERIFY in a block where the soft-fork is active.

Also moves the bip65 functional test out of the extended test suite.
2017-06-30 09:04:36 -04:00
John Newbery 5ba83c1d43 [tests] fix nits.
Thanks to Marco Falke.
2017-06-29 15:06:38 +01:00
Jonas Schnelli d64ac3f4aa [tests] Allow tests to pass when stderr is non-empty
Tests which pass with non-empty stderr are reported as "passed with
warnings"
2017-06-29 14:32:30 +01:00
John Newbery 05b8c081b4 [tests] reorganize utils.py module (code move only)
This commit re-organizes the utils.py module into logical sections.
2017-06-29 11:56:33 +01:00
John Newbery 0d473c539e [tests] move mocktime property and functions to BitcoinTestFramework 2017-06-29 11:55:23 +01:00
John Newbery cad967a892 [tests] Move stop_node and start_node methods to BitcoinTestFramework
This commit moves functions start_node, start_nodes, stop_node and
stop_nodes functions into the BitcoinTestFramework class. It also moves
the bitcoind_processes dict and coverage variables into BitcoinTestFramework.
2017-06-29 11:55:19 +01:00
John Newbery f1fe5368f1 [tests] fix flake8 warnings in test_framework.py and util.py 2017-06-29 11:19:06 +01:00
John Newbery 37065d2ed2 [tests] remove unused imports from utils.py 2017-06-29 11:16:32 +01:00
Wladimir J. van der Laan d4e551adfe
Merge #10148: Use non-atomic flushing with block replay
176c021 [qa] Test non-atomic chainstate writes (Suhas Daftuar)
d6af06d Dont create pcoinsTip until after ReplayBlocks. (Matt Corallo)
eaca1b7 Random db flush crash simulator (Pieter Wuille)
0580ee0 Adapt memory usage estimation for flushing (Pieter Wuille)
013a56a Non-atomic flushing using the blockchain as replay journal (Pieter Wuille)
b3a279c [MOVEONLY] Move LastCommonAncestor to chain (Pieter Wuille)

Tree-SHA512: 47ccc62303f9075c44d2a914be75bd6969ff881a857a2ff1227f05ec7def6f4c71c46680c5a28cb150c814999526797dc05cf2701fde1369c06169f46eccddee
2017-06-28 18:26:41 +02:00
MarcoFalke 416af3edf5
Merge #10690: [qa] Bugfix: allow overriding extra_args in ComparisonTestFramework
4ed3653 [qa] Bugfix: allow overriding extra_args in ComparisonTestFramework (Suhas Daftuar)

Tree-SHA512: d8f724b3324aad73a7b15cf87ff394e8d615bf3cd5a394d5715347d833f2ae9ac745a944202986866255eca5fc105ea06ab3abe12e168b67de34482f751c68e2
2017-06-28 18:09:58 +02:00
Suhas Daftuar 4ed36539bc [qa] Bugfix: allow overriding extra_args in ComparisonTestFramework 2017-06-28 08:53:20 -04:00
Wladimir J. van der Laan acb11535cb
Merge #10659: [qa] blockchain: Pass on closed connection during generate call
fab1fb7 [qa] blockchain: Pass on closed connection during generate call (MarcoFalke)

Tree-SHA512: 754be08675c3aca6f8003dc4bc68336e3693609ec14afc91cec592603aabe515f82534ef7b3db469792458ae4c70d5eae0ea0e8abd0ea338e22351aa01173046
2017-06-27 19:27:57 +02:00
John Newbery 11ba8e9cdd [tests] rename getblocktemplate_proposals.py to mining.py 2017-06-27 16:02:18 +01:00
John Newbery b29dd41f0f [tests] add test for submit block 2017-06-27 15:51:37 +01:00
John Newbery 9bf0d80ab0 [tests] run successful test in getblocktemplate first 2017-06-27 15:51:37 +01:00
John Newbery 82dc59706e [tests] don't build blocks manually in getblocktemplate test 2017-06-27 15:51:37 +01:00
John Newbery f82c709fbe [tests] clarify assertions in getblocktemplate test 2017-06-27 15:51:37 +01:00
John Newbery 66c570a38e [tests] Don't build the coinbase manually in getblocktemplate test 2017-06-27 15:51:37 +01:00
John Newbery 38b38cd2d1 [tests] getblocktemplate_proposals.py: add logging 2017-06-27 15:51:37 +01:00
John Newbery 0a3a5ff454 [tests] Fix flake8 warnings in getblocktemplate tests 2017-06-27 15:51:37 +01:00
John Newbery 32cffe6bef [tests] Fix import order in getblocktemplate test 2017-06-27 15:51:37 +01:00
Wladimir J. van der Laan 7c87a9c748
Merge #10612: The young person's guide to the test_framework
e7ba6c1 [tests] add example test (John Newbery)
76859e6 [tests] Update functional tests documentation (John Newbery)

Tree-SHA512: 74eb464e965e16466f95b9eda7d1e89a31ef1ef204dd30e1b11ddf482336f12f33fa5ca3cc733b6eaf440c46401e663585af9caca202deddb440bbadce964a62
2017-06-27 12:07:21 +02:00
John Newbery e7ba6c16b3 [tests] add example test 2017-06-27 05:04:52 -04:00
John Newbery 76859e6a76 [tests] Update functional tests documentation 2017-06-27 05:04:52 -04:00
Suhas Daftuar 176c021d08 [qa] Test non-atomic chainstate writes
Adds new functional test, dbcrash.py, which uses -dbcrashratio to exercise the
logic for recovering from a crash during chainstate flush.

dbcrash.py is added to the extended tests, as it may take ~10 minutes to run

Use _Exit() instead of exit() for crash simulation

This eliminates stderr output such as:
    terminate called without an active exception
or
    Assertion failed: (!pthread_mutex_destroy(&m)), function ~recursive_mutex, file /usr/local/include/boost/thread/pthread/recursive_mutex.hpp, line 104.

Eliminating the stderr output on crash simulation allows testing with
test_runner.py, which reports a test as failed if stderr is produced.
2017-06-26 14:48:42 -07:00
Ricardo Velhote c07475294a
[RPC] Add an uptime command that displays the amount of time that bitcoind has been running 2017-06-25 20:25:45 +01:00
MarcoFalke fab1fb737b [qa] blockchain: Pass on closed connection during generate call 2017-06-23 09:17:13 +02:00
Wladimir J. van der Laan 6bef7ca8bc
Merge #10633: doc: Fix various typos
0a5a6b9 Fixed multiple typos (Dimitris Tsapakidis)

Tree-SHA512: 57748710bcbc03945b160db5e95bd686a2c64605f25d5e11d8ed9d0e1be3b3bf287a63588dc6eb33d0cef4ff17c765fda7c226d667a357acc539c8fcf2b9bb7e
2017-06-22 20:46:37 +02:00
MarcoFalke 4bc853b50f
Merge #10636: [qa] util: Check return code after closing bitcoind proc
999923e [qa] util: Check return code after closing bitcoind proc (MarcoFalke)

Tree-SHA512: 1aa911e5ce25ef59b006b7f8f25e5eef3c6c31f1b4362564e158ed92dd7804625fccc08be8b98c8c32779b530a8ec988819947692698214e34f5cb1d411c9eda
2017-06-22 20:16:20 +02:00
Dimitris Tsapakidis 0a5a6b90bc Fixed multiple typos
A few "a->an" and "an->a".
"Shows, if the supplied default SOCKS5 proxy" -> "Shows if the supplied default SOCKS5 proxy". Change made on 3 occurrences.
"without fully understanding the ramification of a command" -> "without fully understanding the ramifications of a command".
Removed duplicate words such as "the the".
2017-06-22 19:18:10 +03:00
MarcoFalke c68a9a6927
Merge #10632: qa: Add stopatheight test
5555fa8 qa: Add stopatheight test (MarcoFalke)

Tree-SHA512: ea3f318c3dc73a885db5e258f5d6a25e0017e2360a72ac5f6914bce6f7798d36aca45d2626aafd57ead744bd28fd38b561207a7a547a1d417e594976c35bccee
2017-06-22 10:50:44 +02:00
Wladimir J. van der Laan d083bd9b9c
Merge #10533: [tests] Use cookie auth instead of rpcuser and rpcpassword
279fde5 Check for rpcuser/rpcpassword first then for cookie (Andrew Chow)
3ec5ad8 Add test for rpcuser/rpcpassword (Andrew Chow)
c53c983 Replace cookie auth in tests (Andrew Chow)

Tree-SHA512: 21efb84c87080a895cac8a7fe4766738c34eebe9686c7d10af1bf91ed4ae422e2d5dbbebffd00d34744eb6bb2d0195ea3aca86deebf085bbdeeb1d8b474241ed
2017-06-21 14:53:57 +02:00
MarcoFalke 999923e4bb [qa] util: Check return code after closing bitcoind proc
This has no effect on the outcome of test cases, but
prints shorter and less confusing tracebacks on fails.

I.e. does not print an obvious "ConnectionRefusedError"
when shutting down the nodes due to an invalid return code.
2017-06-20 13:55:05 +02:00
MarcoFalke 5555fa8b74 qa: Add stopatheight test 2017-06-20 13:35:12 +02:00
Andrew Chow 279fde58e3 Check for rpcuser/rpcpassword first then for cookie
Better to check that rpcuser and rpcpassword exist then to check for
the cookie in the test framework.

Name an argument for consistency in p2p-segwit.py
2017-06-18 10:34:54 -07:00
MarcoFalke 643fa0b22d
Merge #10555: [tests] various improvements to zmq_test.py
0a4912e [tests] timeout integration tests on travis after 20 minutes (John Newbery)
7c51e9f [tests] destroy zmq context in zmq_tests.py (John Newbery)
b1bac1c [tests] in zmq test, timeout if message not received (John Newbery)
5ebd5f9 [tests] tidy up zmq_test.py (John Newbery)
4a0c08f [tests] update zmq test to use correct config.ini file (John Newbery)

Tree-SHA512: 5e607af2f2dc5c73fba4b2d3890097580a7525f6a4996c7c78f01822e45e0054fd0a225ea53fce6308804e560cced6de6cf5d16137469dcf100b2e9643e08d03
2017-06-18 14:14:25 +02:00
Wladimir J. van der Laan c94b89e90d
Merge #9738: gettxoutproof() should return consistent result
6294f32 gettxoutproof() should return consistent result (John Newbery)

Tree-SHA512: 1c36f78ea07a3bdde09e9494207b4372d54bcd94ed2d56e339e78281f6693e26a93e4c3123453d5c0f6e994d0069d5a1c806786c4af71864f87ea4841611c379
2017-06-14 15:48:52 +02:00
Wladimir J. van der Laan 6702617c86
Merge #10551: [Tests] Wallet encryption functional tests
ec98b78 Tests for wallet encryption stuff (Andrew Chow)

Tree-SHA512: 176f146dee87f7eaf6de689598ddf257264bb77c2f8c0f9b00276e0dd956327463fb50403a32916f00765d2b2a588c1692a600b36bb3c9e7fa2f18d7cc3b4bc0
2017-06-14 15:27:54 +02:00
John Newbery 0a4912e46a [tests] timeout integration tests on travis after 20 minutes 2017-06-12 09:17:18 -04:00
John Newbery 7c51e9f0dc [tests] destroy zmq context in zmq_tests.py 2017-06-12 09:17:18 -04:00
John Newbery b1bac1cb7e [tests] in zmq test, timeout if message not received 2017-06-12 09:13:03 -04:00
Andrew Chow 3ec5ad88e6 Add test for rpcuser/rpcpassword 2017-06-08 17:19:39 -07:00
John Newbery 5ebd5f9e15 [tests] tidy up zmq_test.py 2017-06-08 15:18:32 -04:00
Andrew Chow c53c9831ee Replace cookie auth in tests
Since rpcuser and rpcpassword are now deprecated, replace them with cookie auth.

Fix test failures with cookie auth
2017-06-08 11:22:52 -07:00
Andrew Chow ec98b78e1e Tests for wallet encryption stuff
Added a functional test which tests the encryptwallet, walletpassphrase, walletpassphrasechange, and walletlock RPCs
2017-06-08 11:07:11 -07:00
John Newbery 4a0c08fdcf [tests] update zmq test to use correct config.ini file 2017-06-08 09:20:53 -04:00
practicalswift 9f841a6c3d [tests] Remove accidental trailing semicolon 2017-06-08 09:44:32 +02:00
John Newbery 6294f3283a gettxoutproof() should return consistent result
We can call gettxoutproof() with a list of transactions. Currently, if
the first transaction is unspent (and all other transactions are in the
same block), then the call will succeed. If the first transaction has
been spent, then the call will fail. The means that the following two
calls will return different results:

gettxoutproof(unspent_tx1, spent_tx1)
gettxoutproof(spent_tx1, unspent_tx1)

This commit makes behaviour independent of transaction ordering by looping
through all transactions provided and trying to find which block they're in.

This commit also increases the test coverage and tests more failure
cases for gettxoutproof()
2017-06-07 17:38:21 -04:00
Wladimir J. van der Laan 46311e792f
Merge #9672: Opt-into-RBF for RPC & bitcoin-tx
9a5a1d7 RPC/rawtransaction: createrawtransaction: Check opt_into_rbf when provided with either value (Luke Dashjr)
23b0fe3 bitcoin-tx: rbfoptin: Avoid touching nSequence if the value is already opting in (Luke Dashjr)
b005bf2 Introduce MAX_BIP125_RBF_SEQUENCE constant (Luke Dashjr)
575cde4 [bitcoin-tx] add rbfoptin command (Jonas Schnelli)
5d26244 [Tests] extend the replace-by-fee test to cover RPC rawtx features (Jonas Schnelli)
36bcab2 RPC/Wallet: Add RBF support for fundrawtransaction (Luke Dashjr)
891c5ee Wallet: Refactor FundTransaction to accept parameters via CCoinControl (Luke Dashjr)
578ec80 RPC: rawtransaction: Add RBF support for createrawtransaction (Luke Dashjr)

Tree-SHA512: 446e37c617c188cc3b3fd1e2841c98eda6f4869e71cb3249c4a9e54002607d0f1e6bef92187f7894d4e0746ab449cfee89be9f6a1a8831e25c70cf912eac1570
2017-06-07 15:31:40 +02:00
MarcoFalke 75e898c094
Merge #10331: Share config between util and functional tests
8ad5bde Merge bctest.py into bitcoin-util-test.py (John Newbery)
95836c5 Use shared config file for functional and util tests (John Newbery)
89fcd35 Use an .ini config file for environment vars in bitcoin-util-test.py (John Newbery)
e9265df Change help_text in bitcoin-util-test.py to a docstring. (John Newbery)
ce58e93 Change bitcoin-util-test.py to use Python3 (John Newbery)

Tree-SHA512: 66dab0b4a8546aee0dfaef134a165f1447aff4c0ec335754bbc7d9e55909721c62f09cdbf4b22d02ac1fcd5a9b66780f91e1cc4d8687fae7288cc9072a23a78f
2017-06-06 23:55:24 +02:00
Wladimir J. van der Laan 980deaf0b1
Merge #10252: RPC/Mining: Restore API compatibility for prioritisetransaction
870824e RPC/Mining: Restore API compatibility for prioritisetransaction (Luke Dashjr)

Tree-SHA512: eb507500dc5ba8d17521f34f3d6eae45aa9259c38d15a75dc3e3ad45774ffb53db943be1720a97e6cd5f08e7832801e27ffb636da081a58955018b6f8f9d8fba
2017-06-06 15:49:38 +02:00
MarcoFalke 30853e16d3
Merge #10535: [qa] fundrawtx: Fix shutdown race
fa62dad [qa] fundrawtx: Fix shutdown race (MarcoFalke)

Tree-SHA512: bf1a3dd053a0f950639bb78fc6ef6255cc5e0b3d27efb97d956f4bd3342839c28a91d8d0793ef7473ab0c8beda30034767031060ae1895408513aa1d9f7c9ff4
2017-06-06 12:28:59 +02:00
Wladimir J. van der Laan 16f6c98fa8
Merge #10426: Replace bytes_serialized with bogosize
8b22af3 Replace bytes_serialized with bogosize (Pieter Wuille)

Tree-SHA512: e70a981bbb977329f9e324c45f9a1346ec9aacfbbad5474e608cdd1f852257502bb7db8003fd578260a609e45d1a9cf87ce96df9c4187d92d50f60a209e232ce
2017-06-06 11:46:31 +02:00
Wladimir J. van der Laan 323a46e034
Merge #10463: Names: BIP9 vs versionbits
b463bc9 scripted-diff: s/BIP9DeploymentInfo/VBDeploymentInfo/ (Jorge Timón)
29c0719 Rename -bip9params to -vbparams (shaolinfry)

Tree-SHA512: a8a2bf6e24a4a7fc82f784c78c0cd92472e9ba55ce3fb22dafef3eccdcfccb2da5a6078fbeec1a8a4b6ab1f1b226976c5aba964dd5e3d029a21b109a7c044374
2017-06-06 10:18:02 +02:00
MarcoFalke fa62dadabe [qa] fundrawtx: Fix shutdown race 2017-06-06 01:23:01 +02:00
Jonas Schnelli 5d26244148 [Tests] extend the replace-by-fee test to cover RPC rawtx features 2017-06-05 23:13:24 +00:00
Pieter Wuille 8b22af3ee5 Replace bytes_serialized with bogosize 2017-06-05 12:43:45 -07:00
Wladimir J. van der Laan 9fec4da0be
Merge #9740: Add friendly output to dumpwallet
164019d Add dumpwallet output test (aideca)
9f82134 Add friendly output to dumpwallet refs #9564 (aideca)

Tree-SHA512: 913fcf18d42eebe34173f1f2519973494b1ad2d86d125ff4bf566d6c64aa501c02f8831e6f44812cd87a46916f61c6f510146af406865b31856d8336c173569f
2017-06-05 18:06:34 +02:00
MarcoFalke c871f323b4
Merge #10515: [test] Add test for getchaintxstats
cc36b5e [test] Add test for getchaintxstats (Jimmy Song)

Tree-SHA512: a992b55f945118ad7410ab8d7ae7d2696e94a2d4a861d633f4501c439364027e2fddd522cb8b5ed3eb621ec4ed0e9fc683e0139aa6c2e2e27c361640f85f1876
2017-06-05 16:25:18 +02:00
Wladimir J. van der Laan 3457331386 test: Add test for `getpeerinfo` `bindaddr` field 2017-06-05 13:57:13 +02:00
Jimmy Song cc36b5e3d7 [test] Add test for getchaintxstats 2017-06-02 21:48:32 -07:00
MarcoFalke 329fc1dce7
Merge #10359: [tests] functional tests should call BitcoinTestFramework start/stop node methods
53f6775 fixup: fix nits (John Newbery)
a433d8a [tests] Update start/stop node functions to be private module functions (John Newbery)
d8c218f [tests] Functional tests call self.start_node(s) and self.stop_node(s) (John Newbery)

Tree-SHA512: 9cc01584a5e57686b7e7cb1c4c5186ad8cc7eb650d6d4f27b06bdb5e249a10966705814bdfb22d9ff2d5d3326911e489bf3d22257d751a299c0b24b7f40bffb5
2017-06-02 12:10:41 +02:00
MarcoFalke 1aefc94dd7
Merge #10423: [tests] skipped tests should clean up after themselves
930deb9 [tests] skipped tests should clean up after themselves (John Newbery)

Tree-SHA512: ed486c1cf144c223efa738a66e8bb407089a23002871ef5b15c43d4c08641038a20253fc286853b457d66f37a52c81c16f7988aef90635ac262df6ce7bab9b18
2017-06-02 11:33:18 +02:00
Pieter Wuille 1088b02f0c
Merge #10195: Switch chainstate db and cache to per-txout model
589827975 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc7f Increase travis unit test timeout (Pieter Wuille)
73de2c1ff Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552f7 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b02309 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c0c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357f3 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b79a Pack Coin more tightly (Pieter Wuille)
97072d668 Remove unused CCoins methods (Pieter Wuille)
ce23efaa5 Extend coins_tests (Pieter Wuille)
508307968 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e79 Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b56f Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3cb Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e48397 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c1b Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957a3 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe92 Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
000391132 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111a0 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fdac Replace CTxInUndo with Coin (Pieter Wuille)
422634e2f Introduce Coin, a single unspent output (Pieter Wuille)
7d991b55d Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c119 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d34242430 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e0032290 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652fc Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e7e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde6d Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3
2017-06-01 16:20:27 -07:00
John Newbery 53f6775fe1 fixup: fix nits 2017-06-01 10:08:24 -04:00
Wladimir J. van der Laan ef2d062c9f
Merge #10450: Fix bumpfee rpc "errors" return value
1b6602f Fix bumpfee rpc "errors" return value (Russell Yanofsky)

Tree-SHA512: a55d4dbe28c75f31fde3b7de60479265bb8f3777f432d1db321f1dd848d5274c353f757b09ed3cad9c69c08acbf3906679d27052267db943ab2b19629f79bd81
2017-06-01 10:48:19 +02:00
John Newbery a433d8a15e [tests] Update start/stop node functions to be private module functions
This commit marks the start/stop functions in util.py as private module
functions. A future PR will remove these entirely and move the
functionality directly into the BitcoinTestFramework class, but setting them as
private in this PR will prevent anyone from accidentally calling them
before that future PR is merged.
2017-05-31 16:59:38 -04:00
John Newbery d8c218f9c2 [tests] Functional tests call self.start_node(s) and self.stop_node(s)
This commit changes the individual test scripts to call the
start_node(s) and stop_node(s) methods in BitcoinTestFramework.
2017-05-31 16:59:38 -04:00
shaolinfry 29c07196d0
Rename -bip9params to -vbparams 2017-05-30 19:21:51 +02:00
Wladimir J. van der Laan acd9957b72
Merge #9208: Improve DisconnectTip performance
c1235e3 Add RecursiveDynamicUsage overload for std::shared_ptr (Russell Yanofsky)
71f1903 Store disconnected block transactions outside mempool during reorg (Suhas Daftuar)
9decd64 [qa] Relax assumptions on mempool behavior during reorg (Suhas Daftuar)

Tree-SHA512: c160ad853a5cd060d0307af7606a0c77907497ed7033c9599b95e73d83f68fdfcd4214bd8a83db1c5b7a58022722b9de1ed2e6ea2e02f38a7b6c717f079dd0c6
2017-05-30 18:43:03 +02:00
Pieter Wuille c3aa0c1194 Report on-disk size in gettxoutsetinfo 2017-05-26 13:33:39 -07:00
Pieter Wuille d342424301 Remove/ignore tx version in utxo and undo
This makes the following changes:
* In undo data and the chainstate database, the transaction nVersion
  field is removed from the data structures, always written as 0, and
  ignored when reading.
* The definition of hash_serialized in gettxoutsetinfo is changed to no
  longer incude the nVersion field. It is renamed to hash_serialized_2
  to avoid confusion. The new definition also includes transaction
  height and coinbase information, as this information was missing
  before.

This depends on having a CHashVerifier-based undo data checksum
verifier.

Apart from changing the definition of serialized_hash, downgrading
after using this patch is supported, as no release ever used the value
of nVersion field in UTXO entries.
2017-05-26 13:27:50 -07:00
Gregory Maxwell 513da90cdd Add test for empty chain and reorg consistency for gettxoutsetinfo. 2017-05-25 09:09:09 +00:00
Russell Yanofsky 1b6602fbe6 Fix bumpfee rpc "errors" return value 2017-05-24 16:15:26 -04:00
Luke Dashjr 870824e919 RPC/Mining: Restore API compatibility for prioritisetransaction
Breaking API serves no purpose other than to be incompatible with older versions and other implementations that do support priority
2017-05-23 20:46:14 +00:00
Wladimir J. van der Laan 46771514fa
Merge #9571: RPC: getblockchaininfo returns BIP signaling statistics
557c9a6 RPC: getblockchaininfo: BIP9 stats (Matthew Zipkin)

Tree-SHA512: ecf0bf47f04f92becc77acc649fdfa270e768939acce42df39d30069398d40d9a30539862f7c307e08239f78d5c58c470ca5f6e717d2ab8e24db9be0dd7bec0c
2017-05-23 19:12:29 +02:00
John Newbery 930deb9b2c [tests] skipped tests should clean up after themselves 2017-05-22 14:46:18 -04:00
MarcoFalke 8e5725666b
Merge #10433: [tests] improve tmpdir structure
b040243 [tests] improve tmpdir structure (John Newbery)

Tree-SHA512: b21ad555c3c23a43087b893ad18bd2398e1df91b82c0bf1804d07fdb582600a1c339e6f4aaca58074e52f146f459943a0e492abc045b2666d4a3a7e0e455d6dd
2017-05-22 08:59:48 +02:00
John Newbery b040243cc3 [tests] improve tmpdir structure 2017-05-18 18:11:32 -04:00
Pieter Wuille e317c0d192
Merge #8384: Add witness data output to TxInError messages
6e9e026 Expand signrawtransaction.py to cover error witness checking (Gregory Sanders)
9f7341b Add witness data output to TxInError messages (Gregory Sanders)

Tree-SHA512: 6f2a758544fa2657f3a57051bdb80fb14cb10501c8ef4ccbab7a62d4b6a823e74f40991c8796248865def24619b620b859dc2bb08dc2cc72511c1cf3897ab1a9
2017-05-17 17:14:18 -07:00
Pieter Wuille bee3529971
Merge #10196: Bugfix: PrioritiseTransaction updates the mempool tx counter
6c2e25c [qa] Test prioritise_transaction / getblocktemplate interaction (Suhas Daftuar)
acc2e4b Bugfix: PrioritiseTransaction updates the mempool tx counter (Suhas Daftuar)

Tree-SHA512: dcf834df52d84d5eb86acb847c3f28d3cffd1f78f3092b8ff8913c2c400675a071c48a19cd852fdbaac1582aa1dba23433e0e16055831ef2a5e76dde91199941
2017-05-17 13:25:22 -07:00
Pieter Wuille 318ea50a1c
Merge #10199: Better fee estimates
38bc1ec Make more json-like output from estimaterawfee (Alex Morcos)
2d2e170 Comments and improved documentation (Alex Morcos)
ef589f8 minor cleanup: remove unnecessary variable (Alex Morcos)
3ee76d6 Introduce a scale factor (Alex Morcos)
5f1f0c6 Historical block span (Alex Morcos)
aa19b8e Clean up fee estimate debug printing (Alex Morcos)
10f7cbd Track first recorded height (Alex Morcos)
3810e97 Rewrite estimateSmartFee (Alex Morcos)
c7447ec Track failures in fee estimation. (Alex Morcos)
4186d3f Expose estimaterawfee (Alex Morcos)
2681153 minor refactor: explicitly track start of new bucket range and don't update curNearBucket on final loop. (Alex Morcos)
1ba43cc Make EstimateMedianVal smarter about small failures. (Alex Morcos)
d3e30bc Refactor to update moving average on fly (Alex Morcos)
e5007ba Change parameters for fee estimation and estimates on all 3 time horizons. (Alex Morcos)
c0a273f Change file format for fee estimates. (Alex Morcos)

Tree-SHA512: 186e7508d86a1f351bb656edcd84ee9091f5f2706331eda9ee29da9c8eb5bf67b8c1f2abf6662835560e7f613b1377099054f20767f41ddcdbc89c4f9e78946d
2017-05-17 13:15:07 -07:00
Gregory Sanders 6e9e026656 Expand signrawtransaction.py to cover error witness checking 2017-05-17 13:30:42 -04:00
Wladimir J. van der Laan ea1fd43bb9
Merge #10257: [test] Add test for getmemoryinfo
d4668f3 [test] Add test for getmemoryinfo (Jimmy Song)

Tree-SHA512: f5285022504f7f3a5d85981c7c424e5cf1156167dbc4209933ea2a699b741e427f4f908f6d49435376c0e23347db24eb1129b74805cbfce5e0b4ce9e48f71fb0
2017-05-17 18:51:39 +02:00
Wladimir J. van der Laan 541199788c
Merge #10374: qa: Warn when specified test is not found
fac79e4 qa: Warn when specified test is not found (MarcoFalke)

Tree-SHA512: d11ecdde275309b12e23155f6cd8e26c99217436b5094a70dd51b95ae7688754227628dd9a801eb6a52ff3ebea4420938e2fc8e9dc9cd77a4dd5c28d2b822354
2017-05-17 08:12:51 +02:00
MarcoFalke 8bd16ee12f
Merge #10376: [tests] fix disconnect_ban intermittency
3ba2c08 [tests] fix disconnect_ban intermittency (John Newbery)

Tree-SHA512: f4e1a88b4126ad5e1aa861a99f9b2589194a25610b5e18bcc196e7dccfa02491f0b9549fbb9f9a73776ed5ee2f6b8ade264b92ac378a25c1a92df4b0272487a7
2017-05-15 22:49:55 +02:00
MarcoFalke 87abe20fc1
Merge #10253: [test] Add test for getnetworkhashps
de487b7 Tests: Add test for getnetworkhashps (Jimmy Song)

Tree-SHA512: b1418ad904618f639ffa34dd40906692aff1fdf1a0d13a9af00039e7a6a2b758091734b89c0c91e8d455da6b15a0e435a9a9ca97a41d97bf395b844c761ffa27
2017-05-14 12:43:40 +02:00
MarcoFalke fac79e4d18 qa: Warn when specified test is not found 2017-05-14 12:39:02 +02:00
Wladimir J. van der Laan eb8263bdc9
Merge #10317: Remove unused Python imports
0c60c63 Remove unused Python imports (practicalswift)

Tree-SHA512: c7ae6a8ae2c751b771804960498bf270ab022c80fa9e1b39118d5986d890c8cdfc27a3cc24bf28c080d8088ddc11facd1f2881ba2c209cdd819675fda4689d83
2017-05-11 19:27:18 +02:00
Alex Morcos 3810e976d6 Rewrite estimateSmartFee
Change the logic of estimateSmartFee to check a 60% threshold at half the target, a 85% threshold at the target and a 95% threshold at double the target. Always check the shortest time horizon possible and ensure that estimates are monotonically decreasing.  Add a conservative mode, which makes sure that the 95% threshold is also met at longer time horizons as well.
2017-05-10 11:47:44 -04:00
Jimmy Song d4668f35ab [test] Add test for getmemoryinfo
Checks memory before and after a transaction that requires a private key.
Each time, 32 bytes of memory for a private key should be used.
Tested in wallet.py instead of its own file to save testing time.
2017-05-09 14:48:10 -07:00
John Newbery 3ba2c08980 [tests] fix disconnect_ban intermittency 2017-05-09 17:20:24 -04:00
MarcoFalke f6241b3e42
Merge #10361: qa: disablewallet: Check that wallet is really disabled
fa7396d qa: disablewallet: Check that wallet is really disabled (MarcoFalke)

Tree-SHA512: 8c999ae0763fad389ba06f23cca3f589edaaf6dabd29ea8493413eee574ef2c1d49a69cb1158d8b28254cf922277a86b45747e50f44ebc9b0545297c3987289d
2017-05-09 23:15:18 +02:00
John Newbery 56befa03ac [tests] increase timeouts in sendheaders test 2017-05-09 09:06:26 -04:00
John Newbery b0bfa233a1 [tests] Make wait_until timeout 60 seconds by default 2017-05-09 08:55:13 -04:00
MarcoFalke fa7396d6d9 qa: disablewallet: Check that wallet is really disabled 2017-05-08 21:05:40 +02:00
MarcoFalke 6a796b2b53
Merge #10342: [tests] Improve mempool_persist test
329ac3b [tests] use wait_until in mempool_persist.py (John Newbery)

Tree-SHA512: 3f5fe3dcdb5da3b10a41f7b88d29c15b79c02fbb037914b4342b77428f2afe8b342f6adacb28a9eb5549aa156cd146175389bd61909a20df3fecb88361c4779f
2017-05-08 20:14:36 +02:00
John Newbery 329ac3bab1 [tests] use wait_until in mempool_persist.py 2017-05-08 14:00:40 -04:00
MarcoFalke 23d78c4dd0
Merge #10352: test: Add elapsed time to RPC tracing
20187e4 test: Add elapsed time to RPC tracing (Wladimir J. van der Laan)

Tree-SHA512: f271acedd14020cf911711577f6dd940850fa84d2577618af06a2247c940fcc5b339a86c1c7a179899c556d217a6c967c785fb311bba43a9b6073cbe470b6737
2017-05-08 19:32:34 +02:00
MarcoFalke fff72de5bf
Merge #10171: [tests] Add node methods to test framework
4550049 Reorganize BitcoinTestFramework class (John Newbery)
b7dd44c Add start and stop node methods to BitcoinTestFramework (John Newbery)
b111324 move initialize_chain() and initialize_chain_clean() to be methods of BitcoinTestFramework (John Newbery)

Tree-SHA512: 17e541aea8ca4c0d1189701499384e26239e2d5905de8adb0f042d3cf4c0bbed79fcaad61d563e1743bf4c62ad4915cebb4714783db839d9c53dfbbedcae6e9a
2017-05-07 15:13:53 +02:00
Wladimir J. van der Laan 20187e4ad0 test: Add elapsed time to RPC tracing
Add elapsed time to output of `--tracerpc`. To find out why tests are
slow.
2017-05-07 09:17:28 +02:00
MarcoFalke 170bc2c381
Merge #10318: [tests] fix wait_for_inv()
3e3c22f [tests] fix wait_for_inv() (John Newbery)

Tree-SHA512: b8070b8461e9c792cc3d9c17fd9d3faf87f550c7c0fc1788e0cd382f0794932b70cc87d480805a3b3c1ca2fdca9f8f1bcb9759300d777d9aaa8d41c016260d93
2017-05-06 12:21:01 +02:00
MarcoFalke 314ebdfcb3
Merge #10134: [qa] Fixes segwit block relay test after inv-direct-fetch was disabled
f19abd9 [qa] Fixes segwit block relay test after inv-direct-fetch was disabled (Suhas Daftuar)

Tree-SHA512: 4df0074cbf3d9d31b7906026dc3296b143c252a81aef47eee0bcdf6cddc2501f83cb8d1b5a13256f9d7e889306d4435f260c1fa827573ae8569bb241a89a5f82
2017-05-06 12:07:27 +02:00
Suhas Daftuar 6c2e25caf6 [qa] Test prioritise_transaction / getblocktemplate interaction 2017-05-06 05:32:28 -04:00
Suhas Daftuar f19abd9053 [qa] Fixes segwit block relay test after inv-direct-fetch was disabled
This test was passing because we never fetch blocks if we only receive
an inv and not the header (after 037159cebf),
and this test wasn't delivering the header.
2017-05-06 05:25:18 -04:00
John Newbery 4550049903 Reorganize BitcoinTestFramework class 2017-05-05 18:05:42 -04:00
John Newbery 965a124427 [tests] Fix abandonconflict.py intermittency 2017-05-05 13:01:27 -04:00
Suhas Daftuar 9decd648ac [qa] Relax assumptions on mempool behavior during reorg
Policy limits (such as chain limits and mempool total size) could reasonably
be enforced more aggressively during a reorg, so use resendwallettransactions
to repopulate the mempool to avoid mined blocks being too small, and increase
the chain limits from the default for this test.

This is in preparation for a change in mempool behavior during a reorg.
2017-05-04 16:50:50 -04:00
John Newbery 95836c5eba Use shared config file for functional and util tests
The functional tests and util tests both require a config file that is
generated by ./configure. This commit merges those two config
files into a single configuration file that can be shared by both tests.

The config from config.ini is put into a Namespace object to maintain
the interface with bctest.py. A future commit could change this
interface to use a dictionary instead of a namespace.
2017-05-03 14:18:30 -04:00
Wladimir J. van der Laan 35da2aeed7
Merge #10327: [tests] remove import-abort-rescan.py
981e586 [tests] remove import-abort-rescan.py (John Newbery)

Tree-SHA512: 8658d42b5ecdefbb71c55849036ee4e8e113abbc9c549730524009fb6eacc50340ffb7ef99fb35809d4abd6b304d491a618e45ff6ded1990f01f18cbcebf2b12
2017-05-03 15:42:58 +02:00
John Newbery 981e586ab8 [tests] remove import-abort-rescan.py
Reverts PR 10225
2017-05-03 09:16:42 -04:00
John Newbery 3e3c22f09d [tests] fix wait_for_inv() 2017-05-03 09:08:29 -04:00
Wladimir J. van der Laan 2a183de0ec
Merge #9966: Control mempool persistence using a command line parameter
a750d77 Add tests for mempool persistence (John Newbery)
91c91e1 Control mempool persistence using a command line parameter. (John Newbery)

Tree-SHA512: 157d01cefd1903b8bfc5cbab42a3cc5e9c1094179bf4b64b3d34c0d4d9b976d593755bfea5c41c631cb758e1de17c6c2058c130d487d20560b7c0bafcddfa520
2017-05-03 11:03:48 +02:00
Wladimir J. van der Laan 83073de4bd
Merge #10307: [tests] allow zmq test to be run in out-of-tree builds
b8251f6 [tests] allow zmq test to be run in out-of-tree builds (John Newbery)

Tree-SHA512: 6946d23bc8a0b57e841a6811989182732d0534989e0e3b94421387f7971379b25a25d238cad22272e04076293275f6e980c8a713fce87ba48c1c4463d9243051
2017-05-03 08:47:37 +02:00
practicalswift 0c60c63de0 Remove unused Python imports 2017-05-02 21:12:36 +02:00
MarcoFalke 75171f099e
Merge #10137: Remove unused import. Remove accidental trailing semicolons.
73b3721 Remove accidental trailing semicolons (practicalswift)
b8d9a86 Remove unused import (practicalswift)

Tree-SHA512: 36ac38952f8a10f36d2300519c583ef77703cff761be97470be97cfda2fec9d5b7ac604e454f174cc2601160e5cef3f227021ab5d3a6febc97fcb486d78754d3
2017-05-02 20:51:16 +02:00
John Newbery b7dd44c528 Add start and stop node methods to BitcoinTestFramework 2017-05-02 14:20:13 -04:00
John Newbery b111324acd move initialize_chain() and initialize_chain_clean() to be methods of BitcoinTestFramework 2017-05-02 14:18:55 -04:00
MarcoFalke 3c5e6c94ca
Merge #10255: [test] Add test for listaddressgroupings
dadfee3 [test] Add test for listaddressgroupings (Jimmy Song)

Tree-SHA512: 21cf0233c7fcf585f9a31306612ae1113ea916d2972b834efef0cb2154bd4dd24d9746d0632c778c699328f7e7a336d2da6e2bac9f0fb657c30290757563ad22
2017-05-02 20:18:34 +02:00
John Newbery c9cc76dcaa [tests] Remove is_network_split from funtional test cases 2017-05-02 13:31:54 -04:00
Wladimir J. van der Laan 8f3e38477e
Merge #10169: [tests] Remove func test code duplication
2a52ae6 Remove duplicate method definitions in NodeConnCB subclasses (John Newbery)
52e15aa Adds helper functions to NodeConnCB (John Newbery)

Tree-SHA512: 2d7909eb85b3bde0fc3ebf133798eca21e561f4b2a2880937750820a42856cfb61fc94e30591c14ac13218bcfae0ebe7c5e8662a7b10f5b02470325c44a86cf1
2017-05-02 19:11:55 +02:00
Wladimir J. van der Laan faf2dea5ea
Merge #10234: [net] listbanned RPC and QT should show correct banned subnets
d6732d8 [tests] update disconnect_ban.py test case to work with listbanned (John Newbery)
77c54b2 [net] listbanned RPC and QT should show correct banned subnets (John Newbery)

Tree-SHA512: edd0e43377d456260d2697213c2829f8483630f3a668b6707d52605faefa610d951d10e6f22a95eff483cbd14faa8ac9b69fa7d3c0b5735c5f3df23fd71282e0
2017-05-02 18:41:58 +02:00
John Newbery b8251f6337 [tests] allow zmq test to be run in out-of-tree builds 2017-05-01 15:12:49 -04:00
Jimmy Song dadfee38e8 [test] Add test for listaddressgroupings
Test added as part of wallet-accounts.py.
Make file a little more flake8 compliant
2017-05-01 11:13:34 -07:00
Wladimir J. van der Laan e2b99b1313
Merge #10294: [Wallet] unset change position when there is no change
7c58863 [Wallet] unset change position when there is no change on exact match (Gregory Sanders)

Tree-SHA512: ce8b9337e4132e32d80f954258d50938052c833a48e39431649d6adb16e3d18626a0ae5d300827e7fa397927fba72a1f066cb31af9b0a3ef7f1feb6024461626
2017-05-01 15:20:51 +02:00
Gregory Sanders 7c588637d4 [Wallet] unset change position when there is no change on exact match 2017-05-01 08:07:09 -04:00
MarcoFalke 492d22f929
Merge #10264: [test] Add tests for getconnectioncount, getnettotals and ping
85f950a [test] Add tests for getconnectioncount, getnettotals and ping (Jimmy Song)

Tree-SHA512: f9cccc749cd897a4e90400173d63da27798fe606ede216bdcfcce73848370327e010fa7ae70bd2974b24b3e688337e2ad18f0959ffed57cae9c0803456bab09a
2017-05-01 12:14:58 +02:00
Jimmy Song dd1ea59624 [test] Add gettxout call
Test gettxout as part of the wallet test.
Tests gettxout with a confirmed/unconfirmed tx with include_mempool flag on and off
2017-04-28 14:54:12 -07:00
Jimmy Song 85f950a5c4 [test] Add tests for getconnectioncount, getnettotals and ping
* Split run_test into 4 separate tests
* Add 2 tests, getconnectioncount and getnettotals
* getnettotals - Strategy of test is to get the network stats before and after a ping. The difference in bytes sent/received is the bytes needed for a ping/pong.
2017-04-28 14:21:30 -07:00
John Newbery d6732d832a [tests] update disconnect_ban.py test case to work with listbanned 2017-04-28 11:24:33 -04:00
Wladimir J. van der Laan e0a7e1994e
Merge #10225: [test] Add aborttrescan tests
ed60970 [test] Test abortrescan command. (Karl-Johan Alm)

Tree-SHA512: 7f617adba65a6df8fdc4b01432992926a06c4a05da4e657653436f7716301fa5d6249d77894a097737e7fb9e118925883f2425c639058b8973680339bb8e61b6
2017-04-25 16:10:50 +02:00
MarcoFalke 1b25b6df0f
Merge #10097: Move zmq test skipping logic into individual test case.
6803e09 Move zmq test skipping logic into individual test case. (John Newbery)

Tree-SHA512: 9d166b53e9acf386c4dafc860b38e2901b331a7505bba9714a2f4e3bdef68b0316c8b76fddbfb620835ddee549cf32fffb3a96a19b0799ad94f2553f55f19a35
2017-04-23 17:54:06 +02:00
MarcoFalke c530c15180
Merge #10023: [tests] remove maxblocksinflight.py (functionality covered by other test)
5f4bcf2 [tests] Remove maxblocksinflight testcase (John Newbery)

Tree-SHA512: 827c8b12f4b52684a973bbfc508c5906e640572e22a96b9420a7aea86ad8d4aa4d6fcc2bb091f747e2fdd18c897e0456baff254bd5e3ceaf721bd3f09a2fd60b
2017-04-23 17:43:08 +02:00
MarcoFalke 2723bcdce3
Merge #10224: [test] Add test for getaddednodeinfo
bc53752 Tests: Add simple test for getaddednodeinfo (Jimmy Song)

Tree-SHA512: d2f8a384fb994b83f881b585db70e7cf57980821074126d254960cb67988a40672ffde065d0ccd9a90f9e3b395d8cd33695c796ecb4b54f69fe74ee2bf7497a6
2017-04-23 17:04:46 +02:00
Jimmy Song de487b730b Tests: Add test for getnetworkhashps 2017-04-21 09:58:29 -07:00
Wladimir J. van der Laan 5352e5e75d
Merge #10223: Tests: Refactor to create witness script creation function
c39a6b9 Tests: Refactor to create witness script creation function (Jimmy Song)

Tree-SHA512: 1dde621c811ea1a2719acb9a9b84825d3f520234da7fc4045da13754d4a6e6736de2fd508a2b6e64226ad95c7e634bf76d36bd0dcd1b37c63e7b1e172ee0816c
2017-04-21 17:29:40 +02:00
Wladimir J. van der Laan f3db4c6013
Merge #10229: Tests: Add test for getdifficulty
821dd5e Tests: Add test for getdifficulty (Jimmy Song)

Tree-SHA512: 3da78c4f88efdaab8374582cda606620beb2f1e9a93119a72b67572702c17c36b68c3abf9d466e8c7fb8ba9e8afa9a172e454c553df10d3054f19b3282d3097b
2017-04-21 17:12:30 +02:00
Karl-Johan Alm ed60970c83
[test] Test abortrescan command. 2017-04-21 12:51:50 +09:00
Jimmy Song bc53752616 Tests: Add simple test for getaddednodeinfo
* net.py test adds a node and sees if it's in the getaddednodeinfo call
* flake8 fixes
2017-04-20 11:29:21 -07:00
Jimmy Song c39a6b9ec8 Tests: Refactor to create witness script creation function
* Refactor blocktools.py so that witness script creation is its own function
* Changed p2p-segwit to use new function
2017-04-20 11:28:45 -07:00
John Newbery 6803e09e6e Move zmq test skipping logic into individual test case.
This commit uses the new skip test funcationality added in
232b6665bc to skip the zmq tests if the
python zmq module is not available or if bitcoind has been built without
zmq support.

This removes the zmq-specific logic from test_runner.py. In general it's
better if test_runner.py has no knowledge of special cases for
individual tests and is a general purpose test runner.
2017-04-20 11:25:33 -04:00
Wladimir J. van der Laan a987def4f6
Merge #10143: [net] Allow disconnectnode RPC to be called with node id
d54297f [tests] disconnect_ban: add tests for disconnect-by-nodeid (John Newbery)
5cc3ee2 [tests] disconnect_ban: remove dependency on urllib (John Newbery)
12de2f2 [tests] disconnect_ban: use wait_until instead of sleep (John Newbery)
2077fda [tests] disconnect_ban: add logging (John Newbery)
395561b [tests] disconnectban test - only use two nodes (John Newbery)
e367ad5 [tests] rename nodehandling to disconnectban (John Newbery)
d6564a2 [tests] fix nodehandling.py flake8 warnings (John Newbery)
23e6e64 Allow disconnectnode() to be called with node id (John Newbery)

Tree-SHA512: a371bb05a24a91cdb16a7ac4fbb091d5d3bf6554b29bd69d74522cb7523d3f1c5b1989d5e7b03f3fc7369fb727098dd2a549de551b731dd480c121d9517d3576
2017-04-20 11:47:22 +02:00
Jimmy Song 821dd5e3e1 Tests: Add test for getdifficulty
Test added to blockchain.py as adding a new test to reduce test run time.
2017-04-19 14:53:44 -07:00
John Newbery d54297f1a8 [tests] disconnect_ban: add tests for disconnect-by-nodeid 2017-04-19 13:47:56 -04:00
John Newbery 5cc3ee24d2 [tests] disconnect_ban: remove dependency on urllib 2017-04-19 13:47:56 -04:00
John Newbery 12de2f252c [tests] disconnect_ban: use wait_until instead of sleep 2017-04-19 13:47:56 -04:00
John Newbery 2077fdacd3 [tests] disconnect_ban: add logging 2017-04-19 13:47:56 -04:00
John Newbery 395561becf [tests] disconnectban test - only use two nodes 2017-04-19 13:47:56 -04:00
John Newbery e367ad5b44 [tests] rename nodehandling to disconnectban 2017-04-19 13:47:56 -04:00
John Newbery d6564a26f4 [tests] fix nodehandling.py flake8 warnings 2017-04-19 13:47:56 -04:00
John Newbery 2a52ae63bf Remove duplicate method definitions in NodeConnCB subclasses
All Node classes in individual test cases subclass from NodeConnCB. Many
have duplicate definitions for methods that are defined in the base
class. This commit removes those duplicate definitions.

This commit removes ~290 lines of duplicate code.
2017-04-18 17:20:09 -04:00
John Newbery 52e15aa4d0 Adds helper functions to NodeConnCB
This commit adds some helper functions to NodeConnCB which are useful
for many tests:

- NodeConnCB now keeps track of the number of each message type that
it's received and the most recent message of each type. Many tests
assert on the most recent block, tx or reject message.
- NodeConnCB now keeps track of its connection state by setting a
connected boolean in on_open() and on_close()
- NodeConnCB now has wait_for_block, wait_for_getdata,
wait_for_getheaders, wait_for_inv and wait_for_verack methods

I have updated the individual test cases to make sure that there are no
namespace problems that cause them to fail with these new definitions.
Future commits will remove the duplicate code.
2017-04-18 15:25:01 -04:00
MarcoFalke 9111df9673
Merge #10219: Tests: Order Python Tests Differently
637706d Tests: Put Extended tests first when they're included (Jimmy Song)

Tree-SHA512: 0a720b2443b3e65f4ad548ecdf822468460fc4f4ecf32385dd79511a01c9ea4c94f0bf765ca593705b19baee1bae254dfcc3952da64b9c51d75b7da7abcdcd28
2017-04-18 09:26:43 +02:00
Jimmy Song 637706dc9e Tests: Put Extended tests first when they're included
* Added documentation in tests/README.md about enabling wallet, utils and daemon.
* Change ordering to make the long-running EXTENDED_TESTS go first.
2017-04-17 15:20:35 -07:00
MarcoFalke d86bb075bf
Merge #10197: [tests] Functional test warnings
08e51c1 [tests] Remove cache directory by default when running test_runner (John Newbery)
c85b080 [test] add warnings to test_runner (John Newbery)

Tree-SHA512: 537a8a258e410102708d1e02893f3f45abe7a3a3290536249381a7dc55d74ca78322804bf34178dec1461ec1c29d8f8358c5901ddd1633f8b301b95bcbb6ce6d
2017-04-17 22:17:22 +02:00
John Newbery a97ed80f97 [tests] test_runner - check unicode 2017-04-17 14:16:43 -04:00
John Newbery 08e51c1c03 [tests] Remove cache directory by default when running test_runner 2017-04-17 10:31:55 -04:00
John Newbery c85b080cc7 [test] add warnings to test_runner 2017-04-17 10:31:55 -04:00
John Newbery 5f4bcf28ef [tests] Remove maxblocksinflight testcase
maxblocksinflight tested that a node would not send get_data messages
for more than 16 new blocks at the same time. bitcoin core no longer
responds to block invs with get_data, since it does headers-first
sync'ing. This test was therefore testing nothing and can be removed.

the sendheaders test script tests that bitcoin will not send get_headers
for more than 16 blocks simultaneously.
2017-04-13 11:48:02 -04:00
aideca 164019d611 Add dumpwallet output test 2017-04-13 08:39:07 +00:00
Wladimir J. van der Laan e96462fbec tests: Fix test_runner return value in case of skipped test
Currently test_runner reports an error if a test case is skipped.
This is not how it should be, only failed tests should cause it to fail.
2017-04-11 19:49:34 +02:00
Wladimir J. van der Laan e19586a8a9
Merge #10135: [p2p] Send the correct error code in reject messages
5d08c9c Send the correct error code in reject messages (John Newbery)

Tree-SHA512: 0cd3ef3ae202584b138cc0bbfba4125635822e0c5a755fb9276a604b39286959ab22dabc3104aa5d7e71358cd69d965de2a333ff04bf3e8ed43cf0296ac01264
2017-04-10 14:44:22 +02:00
MarcoFalke 88799ea1b1
Merge #10124: [test] Suppress test logging spam
45ce471 Reduce spammy test logging (John Newbery)

Tree-SHA512: 64b2ce29fb62a4e738840bbaf93563559451c2ef078ba66ecfc1dbe34adefea61ad2ad2d768444cb2e0b30cb3cbe47e38ed818d4c91f7723a3d1ba9fdd0043f9
2017-04-08 12:34:31 +02:00
John Newbery 45ce471ab0 Reduce spammy test logging
This commit reduces spammy logging by the test framework. It truncates
logging send/receive message in mininode to 500 characters.  mininode
was previously logging the entire message sent received, which can be up
to 1MB for a full block.
2017-04-07 22:16:41 -04:00
John Newbery d80baaa514 fixup - align summary row correctly and make colors/glyphs globals 2017-04-07 09:15:29 -04:00
John Newbery bb92d839d5 [tests] Add unicode symbols for tests passing/failing/skipping 2017-04-06 13:31:47 -04:00
John Newbery 63062bda1a [tests] color test results and sort alphabetically 2017-04-05 18:36:37 -04:00
practicalswift 73b37219d4 Remove accidental trailing semicolons 2017-04-04 21:30:18 +02:00
practicalswift b8d9a86dc3 Remove unused import 2017-04-04 21:30:18 +02:00
Suhas Daftuar ba7dd8bf6f Test prioritisetransaction and ancestor fee state
There is already a similar test for descendant fee state.
2017-04-03 15:48:55 -04:00
Wladimir J. van der Laan ebfd653798
Merge #10077: [qa] Add setnetworkactive smoke test
fa697b7 [qa] Add setnetworkactive smoke test (MarcoFalke)

Tree-SHA512: 7205bae16f551e93383987392702e6853cfb06d4448735815fa116385cbf5deb6c4a8f521efdd43cf3cc59fede3b3d1ffe74e662890b74bcc21b5c13ce1f20b7
2017-04-02 15:39:26 +02:00
MarcoFalke 12af74b289
Merge #10072: Remove sources of unreliablility in extended functional tests
a4fd89f Make forknotify.py more robust (John Newbery)
1f3d78b Wait for connection to open in bip9-softforks.py (John Newbery)

Tree-SHA512: de7d0002ee62ad97059b6f6c89b11f6e9901e3b4164ef6906bcd61e4ca499c277d9034784755966e5baf599869fad611b0b18f5547a384ceb5b7db3cc5bbd132
2017-04-02 12:52:31 +02:00
John Newbery 5d08c9c579 Send the correct error code in reject messages 2017-03-31 14:22:25 -04:00
John Newbery 6a18bb9a36 [tests] sync_with_ping should assert that ping hasn't timed out
sync_with_ping currently returns false if the timeout expires, and it is
the caller's responsibility to fail the test. However, none of the tests
currently assert on sync_with_ping()'s return code. This commit adds an
assert to sync_with_ping so the test will fail if the timeout expires.

This commit also removes all the duplicate implementations of
sync_with_ping() from the individual tests.
2017-03-30 08:39:12 -04:00
John Newbery 6426716a99 Add send_await_disconnect() method to p2p-compactblocks.py
p2p-compactblocks was incorrectly using sync_with_ping() when sending in
invalid block. The node would disconnect us and never respond to the
ping, so the sync_with_ping would just time out after 30 seconds and
continue with the test.

This commit adds a send_await_disconnect() method that sends the
message, and then waits for the node to disconnect us. In this commit
I've added the method to p2p-compactblocks.py, but a future commit could
move it to mininode since it could be useful more generally.

This commit reduces the p2p-compactblock runtime by 30 seconds.
2017-03-30 08:39:12 -04:00
MarcoFalke 8ac8041286
Merge #10109: Remove SingleNodeConnCB
159fe88 Remove SingleNodeConnCB (John Newbery)

Tree-SHA512: 2fc3d060f4ac9445e657134919a871c46987d53eb98d23a858ee9515fc997be7a81923f08f2a37d07d123b55b912ae82ffa0f820d16297b044ab24dcf0788a8a
2017-03-30 09:23:15 +02:00
Wladimir J. van der Laan f34cdcbd80
Merge #9294: Use internal HD chain for change outputs (hd split)
4115af7 Fix rebase issue where pwalletMain was used instead of pwallet Ser./Deser. nInternalChainCounter as last element (Jonas Schnelli)
9382f04 Do not break backward compatibility during wallet encryption (Jonas Schnelli)
1df08d1 Add assertion for CanSupportFeature(FEATURE_HD_SPLIT) (Jonas Schnelli)
cd468d0 Define CWallet::DeriveNewChildKey() as private (Jonas Schnelli)
ed79e4f Optimize GetOldestKeyPoolTime(), return as soon as we have both oldest keys (Jonas Schnelli)
771a304 Make sure we set the wallets min version to FEATURE_HD_SPLIT at the very first point (Jonas Schnelli)
1b3b5c6 Slightly modify fundrawtransaction.py test (change getnewaddress() into getrawchangeaddress()) (Jonas Schnelli)
003e197 Remove FEATURE_HD_SPLIT bump TODO (Jonas Schnelli)
d9638e5 Overhaul the internal/external key derive switch (Jonas Schnelli)
1090502 Fix superfluous cast and code style nits in RPC wallet-hd.py test (Jonas Schnelli)
58e1483 CKeyPool avoid "catch (...)" in SerializationOp (Jonas Schnelli)
e138876 Only show keypoolsize_hd_internal if HD split is enabled (Jonas Schnelli)
add38d9 GetOldestKeyPoolTime: if HD & HD Chain Split is enabled, response max(oldest-internal-key, oldest-external-key) (Jonas Schnelli)
dd526c2 Don't switch to HD-chain-split during wallet encryption of non HD-chain-split wallets (Jonas Schnelli)
79df9df Switch to 100% for the HD internal keypool size (Jonas Schnelli)
bcafca1 Make sure we always generate one keypool key at minimum (Jonas Schnelli)
d0a627a Fix issue where CDataStream->nVersion was taken a CKeyPool record version (Jonas Schnelli)
9af8f00 Make sure we hand out keypool keys if HD_SPLIT is not enabled (Jonas Schnelli)
469a47b Make sure ReserveKeyFromKeyPool only hands out internal keys if HD_SPLIT is supported (Jonas Schnelli)
05a9b49 Fix wrong keypool internal size in RPC getwalletinfo help (Jonas Schnelli)
01de822 Removed redundant IsLocked() check in NewKeyPool() (Jonas Schnelli)
d59531d Immediately return setKeyPool's size if HD or HD_SPLIT is disabled or not supported (Jonas Schnelli)
02592f4 [Wallet] split the keypool in an internal and external part (Jonas Schnelli)

Tree-SHA512: 80d355d5e844b48c3163b56c788ab8b5b5285db0ceeb19858a3ef517d5a702afeca21dbae526d7b8fb4101c2a745af1d92bf557c40cf516780f17992bf678c1a
2017-03-29 12:51:06 +02:00
John Newbery a4fd89fddb Make forknotify.py more robust
forknotify would intermittently fail because the alert file was not
being written fast enough. This commit adds a timeout so the test does
not fail immediately.
2017-03-28 16:22:19 -04:00
John Newbery 1f3d78b4e0 Wait for connection to open in bip9-softforks.py
bip9-sofforks.py stop-starts the bitcoind node twice during the test
run, but it doesn't wait for the connection from mininode to open before
continuing with the test. This leads to race conditions where the test
can fail getblocktemplate() because it has no p2p connections.
2017-03-28 16:15:38 -04:00
John Newbery 159fe88abf Remove SingleNodeConnCB
This commit merges the NodeConnCB and SingleNodeConnCB into a single
class (called NodeConnCB). The original intent for the NodeConnCB was to
be able to have a python 'mininode' connect to multiple running
bitcoinds. This has never been used and can be achieved more easily by
having multiple NodeConns backed by a common datastore if it is ever
needed.

The changes in mininode.py are just code moves (and merging the two
classes into a single class). The code changes in the individual test
cases are changing the subclasses to subclass from NodeConnCB instead of
SingleNodeConnCB. There is a lot of duplicate code in the subclasses
that can be removed in future commits.
2017-03-28 14:16:21 -04:00
practicalswift 85de9d474b Remove call to gettransaction(...) where the result is unused 2017-03-28 15:19:52 +02:00