Commit graph

1212 commits

Author SHA1 Message Date
Pieter Wuille 16203d5df7 Add descriptors to listunspent and getaddressinfo + tests 2018-11-14 14:21:42 -08:00
Wladimir J. van der Laan d50c996a14
Merge #14561: Remove fs::relative call and fix listwalletdir tests
ed2e18398b Remove fs::relative call and fix listwalletdir tests (João Barbosa)

Pull request description:

  The implementation of `fs::relative` resolves symlinks which is not intended
  in ListWalletDir. The replacement does what is required, and `listwalletdir` RPC
  tests are fixed accordingly.

  Also, `fs::recursive_directory_iterator` iteration is fixed to build with boost 1.47.

  Based on #14559

Tree-SHA512: 1da516226073f195285d10d9d9648c90cce0158c5d1eb9c31217bb4abb575cd37f07c00787c5a850554d6120bbc5a3cbc5cb47d4488b32ac6bcb52bc1882d600
2018-10-26 13:25:35 +02:00
Wladimir J. van der Laan 9d4541508b
Merge #14518: rpc: Always throw in getblockstats if -txindex is required
3be209d103 rpc: Always throw in getblockstats if -txindex is required (João Barbosa)

Pull request description:

  Previously blocks with only the coinbase transaction didn't cause
  the RPC error even if the requested stats required -txindex and
  it wasn't enabled.

  Fixes #14499.

Tree-SHA512: d3a6402889e3ce7199632e79eba66d7d471ff7de5c564d35312e2340cc6d84ef544a8172548fbc2eedf5e637b56dc57bbf7a9815ab798c7f226755f897fd8f3e
2018-10-26 13:21:17 +02:00
João Barbosa ed2e18398b Remove fs::relative call and fix listwalletdir tests
The implementation of fs::relative resolves symlinks which is not intended
in ListWalletDir. The replacement does what is required, and listwalletdir
tests are fixed accordingly.

Also, building with boost 1.47 required 2 changes:
 - replace fs::relative with an alternative implementation;
 - fix fs::recursive_directory_iterator iteration.
2018-10-25 15:33:56 +01:00
Chun Kuan Lee 4dca7d0a98 appveyor: Enable multiwallet test 2018-10-24 23:44:34 +08:00
Wladimir J. van der Laan 2b88f67e0b
Merge #14320: [bugfix] wallet: Fix duplicate fileid detection
4ea77320c5 tests: add test case for loading copied wallet twice (Chun Kuan Lee)
2d796faf62 wallet: Fix duplicate fileid (Chun Kuan Lee)

Pull request description:

  The implementation in current master can not detect if the file ID is duplicate with flushed `BerkeleyEnvironment`. This PR would store the file ID in a global variable `g_fileids` and release it when the `BerkeleyDatabase` close. So it won't have to rely on a `Db*`.

  Fix #14304

Tree-SHA512: 0632254b696bb4c671b5e2e5781e9012df54ba3c6ab0f919d9f6d31f374d3b0f8bd968b90b537884ac8c3d2906afdd58c2ce258666263464c7dbd636960b0e8f
2018-10-24 17:37:32 +02:00
MarcoFalke 6241eb3224
Merge #14504: tests: show the progress of functional tests
96c509e4d0 show the progress of functional test (Isidoro Ghezzi)

Pull request description:

  example: (added the progress index `n/m`)
  ```
  1/107 - wallet_hd.py passed, Duration: 27 s
  .........................................................................................
  2/107 - mining_getblocktemplate_longpoll.py passed, Duration: 72 s
  ..................................................................
  3/107 - feature_maxuploadtarget.py passed, Duration: 78 s
  ```

Tree-SHA512: 17b840048222e2c3676a92041b491521fee3b86049b2f2467a225aece40717732341801872d9867fcb7260e904e322c7184b76fca16d2dc687aa75dd741484ad
2018-10-24 11:14:09 -04:00
Chun Kuan Lee 4ea77320c5 tests: add test case for loading copied wallet twice 2018-10-24 23:08:16 +08:00
Wladimir J. van der Laan a74ed3a05b
Merge #14453: rpc: Fix wallet unload during walletpassphrase timeout
8907df9e02 qa: Ensure wallet unload during walletpassphrase timeout (João Barbosa)
321decffa1 rpc: Fix wallet unload during walletpassphrase timeout (João Barbosa)

Pull request description:

  Replaces the raw wallet pointer in the `RPCRunLater` callback with a `std::weak_ptr` to check if the wallet is not expired.

  To test:
  ```
  bitcoind -regtest
  bitcoin-cli -regtest encryptwallet foobar
  bitcoin-cli -regtest walletpassphrase foobar 5 && bitcoin-cli -regtest unloadwallet ""
  ```

  Fixes #14452.

Tree-SHA512: 311e839234f5fb7955ab5412a2cfc1903ee7132ea56a8ab992ede3614586834886bd65192b76531ae0aa3a526b38e70ca2e1cdbabe52995906ff97b49d93c268
2018-10-24 16:44:43 +02:00
MarcoFalke 9dda5fdf64
Merge #14296: [wallet] Remove addwitnessaddress
2b91e42ece [docs] Add release note for removing getwitnessaddress (John Newbery)
ebec90ac97 [wallet] Remove deprecated addwitnessaddress RPC method (John Newbery)
07e3f585ab [test] Remove deprecated addwitnessaddress from feature_segwit.py (John Newbery)
82f2fa03a5 [test] Remove deprecated addwitnessaddress from wallet_bumpfee.py (John Newbery)
9d7ee187a3 [test] Remove deprecated addwitnessaddress from p2p_compactblocks.py (John Newbery)
3cf77f0b3e [tests] Remove deprecated addwitnessaddress call from wallet_dump.py (John Newbery)
bdefc9705d [tests] Remove deprecated addwitnessaddress call from feature_nulldummy (John Newbery)
67d7d67cf3 [test] Fix flake8 warnings in tests (John Newbery)

Pull request description:

  Fully removes the `addwitnessaddress` RPC method, which was deprecated in V0.17

Tree-SHA512: 8fa8a2a721a81262fbdedbe1cef031e6a07aa6abbc9760dbc62738fc4f688b44bd737d0f3cdb1aec046866a6395befbfecde0f34e76a99e11d3cf566cad1d0de
2018-10-24 08:09:48 -04:00
MarcoFalke 94cf1ec948
Merge #14417: Fix listreceivedbyaddress not taking address as a string
d4d70eda33 Fix listreceivedbyaddress not taking address as a string (Eric Scrivner)

Pull request description:

  Fixes #14173. Add the patch in #14173 and include a regression test.

Tree-SHA512: 5a9794e0c43e90d18c899841afbaf15eb9129d7d2f6570fccf0a1793697fe170d224c3c3995b1a35c536fac19819042823d9e3bd23b019d0f03434499243d2f5
2018-10-23 19:04:10 -04:00
MarcoFalke 3668bb335c
Merge #14468: [wallet] Deprecate generate RPC method
ab9aca2bdf [rpc] add 'getnewaddress' hint to 'generatetoaddress' help text. (John Newbery)
c9f02955b2 [wallet] Deprecate the generate RPC method (John Newbery)
aab81720de [tests] Add generate method to TestNode (John Newbery)
c269209336 [tests] Small fixups before deprecating generate (John Newbery)

Pull request description:

  Deprecates the `generate` RPC method.

  For concept discussion, see #14299.

  Fixes #14299.

Tree-SHA512: 16a3b8b742932e4f0476c06b23de07a34d9d215b41d9272c1c9d1e39966b0c2406f17c5ab3cc568947620c08171ebe5eb74fd7ed4b62151363e305ee2937cc80
2018-10-23 18:15:21 -04:00
Isidoro Ghezzi 96c509e4d0
show the progress of functional test
example (added the progress index `n/m`)
```
1/107 - wallet_hd.py passed, Duration: 27 s
.........................................................................................
2/107 - mining_getblocktemplate_longpoll.py passed, Duration: 72 s
..................................................................
3/107 - feature_maxuploadtarget.py passed, Duration: 78 s
```

- clear dots line
```
$ test/functional/test_runner.py -t can_trash
Temporary test directory at can_trash/test_runner_₿_🏃_20181018_220600
1/105 - wallet_hd.py passed, Duration: 21 s
2/105 - mining_getblocktemplate_longpoll.py passed, Duration: 71 s
3/105 - feature_maxuploadtarget.py passed, Duration: 68 s
..................
```

- don't print the `dot` progressive if `--quiet`

- done_str
- nothing commit to check again travis tests
2018-10-22 01:12:42 +02:00
Pieter Wuille ff37459abc Add tests for key origin support 2018-10-20 20:29:02 -07:00
MarcoFalke 73cddb36a8
Merge #14526: docs: Document lint tests
8640631ebc docs: Document lint tests (Mason Simon)

Pull request description:

  Replaces #13708.
  Fixed the macOS nit, and added `codespell` as a requirement.

Tree-SHA512: efdef8238f9d4433cc6403f58075b906d39d6a2114821cb113a16f2fc45d0c10c603588272865edd40a0498d9685ff8ac25d2491d9fcf0f1f328b6d65751ac2c
2018-10-20 23:09:03 -03:00
João Barbosa 8907df9e02 qa: Ensure wallet unload during walletpassphrase timeout 2018-10-20 11:02:35 +01:00
MarcoFalke d433239a8d
Merge #14456: test: forward timeouts properly in send_blocks_and_test
94e21c1501 test: forward timeouts properly in send_blocks_and_test (James O'Beirne)

Pull request description:

  Small change motivated by frustrations while writing `feature_block` tests; when a timeout is passed to `send_blocks_and_test` it isn't forwarded onto constituent waiting calls - you can end up waiting 60 seconds when you articulated e.g. 5. Respect the given timeout all the way down.

Tree-SHA512: 3a964764fc5e3431ae3b17bd642a27a1bd4526541a799ef63696c9dab0289a005a13d645770be6e46ea262d22a58f79d2b407293a39397b036f616fe20c21241
2018-10-20 03:15:13 -03:00
Mason Simon 8640631ebc
docs: Document lint tests 2018-10-20 13:09:05 +08:00
Pieter Wuille b2863c0685
Merge #14426: utils: Fix broken Windows filelock
369244f654 utils: Fix broken Windows filelock (Chun Kuan Lee)

Pull request description:

  Fix broken filelock on Windows, also add a test for this. It's a regression introduced by #13862.

Tree-SHA512: 15665b1930cf39ec71f3ab07def8e2897659f6fd4d2de749d63a5a8ec920e4a04282f12bc262f242b1b3d14d2dd9fa191ddbcf16a46fb927b5b2b14d9f6b5d01
2018-10-19 18:59:47 -07:00
Kristaps Kaupe 7e18673f04 Fix typo 2018-10-20 02:55:41 +03:00
João Barbosa 3be209d103 rpc: Always throw in getblockstats if -txindex is required
Previously blocks with only the coinbase transaction didn't cause
the RPC error even if the requested stats required -txindex and
it wasn't enabled.
2018-10-19 15:28:41 +01:00
Pieter Wuille d387507aec
Merge #14465: tests: Stop node before removing the notification file
ca6d86c322 tests: Stop node before removing the notification file (Chun Kuan Lee)

Pull request description:

  Stop node before removing the notification file to make sure the command has been terminated. After then we could removing those files safely and do not receive any permission error. (See #14446)

  The permission error is Windows specific, documented in python doc:
  >On Windows, attempting to remove a file that is in use causes an exception to be raised

  See https://docs.python.org/3/library/os.html#os.remove

Tree-SHA512: fbdabf3a9a838bb59ba207dd9e9fbdd87c702a99ad66bee0b2b1537f80f8630d22d9d5e9c4ded23a82a66bfc10989227fb024b27393425abe0e5a2ad4e4cbb82
2018-10-18 22:52:49 -07:00
Wladimir J. van der Laan 8eb2cd1dda
Merge #14291: wallet: Add ListWalletDir utility function
d56a068935 docs: Add release notes for listwalletdir RPC (João Barbosa)
0cb3cad166 qa: Add tests for listwalletdir RPC (João Barbosa)
cc3377360c rpc: Add listwalletdir RPC (João Barbosa)
d1b03b8e5f interfaces: Add getWalletDir and listWalletDir to Node (João Barbosa)
fc4db35bfd wallet: Add ListWalletDir utility (João Barbosa)

Pull request description:

  `ListWalletDir` returns all available wallets in the current wallet directory.

  Based on MeshCollider work in pull #11485.

Tree-SHA512: 5843e3dbd1e0449f55bb8ea7c241a536078ff6ffcaad88ce5fcf8963971d48c78600fbc4f44919523b8a92329d5d8a5f567a3e0ccb0270fdd27366e19603a716
2018-10-19 01:01:17 +02:00
João Barbosa 0cb3cad166 qa: Add tests for listwalletdir RPC 2018-10-18 23:26:06 +01:00
John Newbery c9f02955b2 [wallet] Deprecate the generate RPC method 2018-10-18 17:46:48 -04:00
John Newbery aab81720de [tests] Add generate method to TestNode
Adds a generate() method to the TestNode class in the test framework.
This method intercepts calls to generate, imports a dewterministic
private key to the node and then calls generatetoaddress to generate the
block to that address.

Note that repeated calls to importprivkey for the same private keys are
no-ops, so it's fine to call the generate() method many times.
2018-10-18 17:46:48 -04:00
Chun Kuan Lee 369244f654 utils: Fix broken Windows filelock 2018-10-19 02:29:25 +08:00
John Newbery c269209336 [tests] Small fixups before deprecating generate
In advance of deprecating the generate RPC method, make some small
changes to a small number of inidividual test cases:

- make memory checking less prescriptive in wallet_basic.py
- replace calls to generate with generatetoaddress in wallet_keypool.py
- replace calls to generate with generatetoaddress and fixup label
  issues in wallet_labels.py
- replace calls to generate with generatetoaddress in wallet_multiwallet.py
2018-10-16 11:27:13 -04:00
practicalswift c32cf6a0f2 Add ignored word: mut 2018-10-16 13:34:10 +02:00
practicalswift 4ae50daaa7 Revert "qa: Fix codespell error and have lint-spelling error instead of warn"
This reverts commit e413c2ddd1.
2018-10-16 13:33:05 +02:00
Eric Scrivner d4d70eda33 Fix listreceivedbyaddress not taking address as a string
Fixes #14173. Add the patch in #14173 and include a regression test.
2018-10-14 09:48:06 -07:00
Chun Kuan Lee ca6d86c322 tests: Stop node before removing the notification file 2018-10-12 05:57:58 +08:00
James O'Beirne 94e21c1501 test: forward timeouts properly in send_blocks_and_test 2018-10-10 02:51:19 -04:00
MarcoFalke a89896fadb
Merge #13649: test: allow arguments to be forwarded to flake8 in lint-python.sh
854c85ae90 test: allow arguments to be forwarded to flake8 in lint-python.sh (James O'Beirne)

Pull request description:

  In order to use `lint-python.sh` from within various in-editor linting frameworks (e.g. [ALE](https://github.com/w0rp/ale), [flycheck](https://github.com/flycheck/flycheck)), we need to allow its arguments to be forwarded to the wrapped flake8 invocation.

  For what it's worth, here's my bitcoin-specific ALE vim config for doing so (requires this changeset):
  ```vim
  $ grep python /home/james/src/bitcoin/.exrc

  let g:ale_python_flake8_executable="/home/james/src/bitcoin/test/lint/lint-python.sh"
  ```

Tree-SHA512: 0d5500238ea5fde26ee9c21f6518a3a3dc8409c77ad1271ff7e7a94ef45a8c8d2e1b8ad3df3075dd4062ee0fff534625b1bc79613f869cd3c2d9260814ffc7ee
2018-10-08 05:25:46 -03:00
MarcoFalke d12e3d9acc
Merge #14324: qa: Run more tests with wallet disabled
faa4043c66 qa: Run more tests with wallet disabled (MarcoFalke)

Pull request description:

  Instead of skipping the whole test, only skip the wallet specific section of a test if the wallet is not compiled in. This is mostly an indentation change, so can be reviewed with `--ignore-all-space`.

Tree-SHA512: 5941a8b6b00dca5cf9438c5f6f010ba812115188a69e427d7ade4c1ab8cfe7a57c73daf52c66235dbb24b1cd9ab7c7a17c49bc23d931e041b605d79116a71f66
2018-10-08 01:42:02 -03:00
MarcoFalke ab660c8e50
Merge #14413: tests: Allow closed rpc handler in assert_start_raises_init_error
62c304ea48 tests: Allow closed http server in assert_start_raises_init_error (Chun Kuan Lee)

Pull request description:

  The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 `non-JSON HTTP response with \'%i %s\' from server` (503 Service Unavailable)

  See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"

Tree-SHA512: e1f50ab9096cf23494ccc2850c01516c4a75f112c99108759157b22fce2011682a4b88216f206702f6a56e960182c00098053ad75f13aa0eafe27046adae63da
2018-10-08 01:29:22 -03:00
Chun Kuan Lee 62c304ea48 tests: Allow closed http server in assert_start_raises_init_error 2018-10-08 11:48:19 +08:00
MarcoFalke 02a0242455
Merge #14419: [tests] Remove rpc_zmq.py
42a995ae48 [tests] Remove rpc_zmq.py (John Newbery)

Pull request description:

  rpc_zmq.py is racy and fails intermittently. Remove that test file and
  move the getzmqnotifications RPC test into interface_zmq.py.

Tree-SHA512: 666c8f252f8a392deda1bd531e84fdc04bdae4eab09407657ade2b5fc0aeffa247735e20314236f56e4e3402476673f3b7538d6e09f5af6976021ba2377ce63c
2018-10-07 23:49:43 -03:00
MarcoFalke 60a61611f6
Merge #13883: utils: Convert Windows args to utf-8 string
380c843217 utils: Convert Windows args to utf-8 string (Chun Kuan Lee)

Pull request description:

  Create a new class `WinCmdLineArgs` when building for Windows. It converts all command line arguments to utf8 string.

Tree-SHA512: f098520fd123a8a452bc84a55dc8c0b88f0c475410efe57f2ccc393f86c396eed59ea1575ddc1b920323792e390fdb092061d80cdcd9b682f0ac79a22a22ff82
2018-10-07 22:47:17 -03:00
John Newbery 42a995ae48 [tests] Remove rpc_zmq.py
rpc_zmq.py is racy and fails intermittently. Remove that test file and
move the getzmqnotifications RPC test into interface_zmq.py
2018-10-07 09:32:50 +09:00
practicalswift db01839361 test: Add missing call to skip_if_no_cli() 2018-10-03 10:10:35 +02:00
Chun Kuan Lee 380c843217 utils: Convert Windows args to utf-8 string 2018-09-30 15:08:16 +08:00
MarcoFalke 9b8bb5f140
Merge #14316: tests: exclude all tests with difference parameters in --exclude list
c7b3e487f2 tests: exclude all tests with difference parameters (Chun Kuan Lee)

Pull request description:

  Fix broken exclusion list in functional tests. See https://github.com/bitcoin/bitcoin/pull/14007#pullrequestreview-158309105

Tree-SHA512: b6c2b86fef13e3c00c695adaeeb3e47ee9b48877c71bc605d24201ce931b2ef3ae9f5f199071fa1ec5de2d7aadc478410094c380cc297922e683e9b2569cda03
2018-09-27 12:16:15 -04:00
MarcoFalke 01211cea71
Merge #14307: Consolidate redundant implementations of ParseHashStr
9c5af58d51 Consolidate redundant implementations of ParseHashStr (Ben Woosley)

Pull request description:

  This change:
  * adds a length check to all calls to `ParseHashStr`, appropriate given its use to populate
    a 256-bit number from a hex str
  * allows the caller to handle the failure, which allows for the more
    appropriate `JSONRPCError` on failure in `prioritisetransaction` rpc

  Relative to #14288

Tree-SHA512: baa791147e5ceb3c30c70df3981aaf807bf7d4a90a0be3625540b59aa4b9a9d303a452bfef18bf167cbb833ef9591b4ef5948bf4a1ce67b421d804ae8d20ea53
2018-09-27 11:26:29 -04:00
MarcoFalke b88dd7c2db
Merge #12246: Bugfix: Only run bitcoin-tx tests when bitcoin-tx is enabled
a2a04a5abb Bugfix: Only run bitcoin-tx tests when bitcoin-tx is enabled (Luke Dashjr)
92af71cea9 configure: Make it possible to build only one of bitcoin-cli or bitcoin-tx (Luke Dashjr)

Pull request description:

  Includes #5618 (which the reasons for rejecting no longer hold true)

Tree-SHA512: f30a8e4a2f70166b7cabef77c4674163b3a9da14c6a547d34f00d1056a19bf4d23e22851eea726fad2afc8735d5473ae91122c770b65ac3886663dc20e2c5b70
2018-09-27 11:13:51 -04:00
MarcoFalke edcf29c9da
Merge #14305: Tests: enforce critical class instance attributes in functional tests, fix segwit test specificity
e460232876 Document fixed attribute behavior in critical test framework classes. (Justin Turner Arthur)
17b42f4122 Check for specific tx acceptance failures based on script signature (Justin Turner Arthur)
3a4449e9ad Strictly enforce instance attrs in critical functional test classes. (Justin Turner Arthur)
1d0ce94a54 Fix for incorrect version attr set on functional test segwit block. (Justin Turner Arthur)
ba923e32a0 test: Fix broken segwit test (practicalswift)

Pull request description:

  No extra attributes will be able to be added to instances of the C++ class ports or of other critical classes without causing an exception. Helps prevent adding or depending on attributes that aren't in the intended object structure. It may prevent issues such as the one fixed in bitcoin/bitcoin#14300.

  This request fixes the erroneous version attribute used in the p2p_segwit.py functional tests. This pull includes the commit from bitcoin/bitcoin#14300.

Tree-SHA512: 1b8c58e7aa0f71075ed5ff3e5be0a5182599108d8cd9bce682feac3b1842508124288e9335432b16a43f40f159c9710899e6d84af1b5868f48c947bc6f3e07ec
2018-09-27 11:09:46 -04:00
Justin Turner Arthur e460232876 Document fixed attribute behavior in critical test framework classes.
Per @jimmysong's suggestion in bitcoin/bitcoin#14305. Also corrects
module for network objects and wrappers.
2018-09-26 22:13:06 -05:00
Justin Turner Arthur 17b42f4122 Check for specific tx acceptance failures based on script signature 2018-09-26 21:50:51 -05:00
Justin Turner Arthur 3a4449e9ad Strictly enforce instance attrs in critical functional test classes.
Additionally, removed redundant parentheses and added PEP-8 compliant
spacing around those classes.
2018-09-26 21:50:42 -05:00
MarcoFalke ae1cc010b8
Merge #14282: [wallet] Remove -usehd
7ac911afe7 [docs] Add release notes for removing `-usehd` (John Newbery)
25548b2958 [wallet] Remove -usehd (John Newbery)

Pull request description:

  `-usehd` is no longer used (except to tell the user that they've set it incorrectly for the wallet that they're loading). Remove it (in the same spirit as #14272)

Tree-SHA512: 5bdcd2bb9bb8504a01343595bcd1bd433d97b730255152c725103c1ac3fa3a9d9e5220a4c29d4c72307cf803e1c09d31080f83603c23dc77263846e17b1826f0
2018-09-26 17:36:28 -04:00