Commit graph

1278 commits

Author SHA1 Message Date
Daniel Kraft 3d2c7d6f94 Add regtest for JSON-RPC batch calls.
This adds a new regtest file 'interface_rpc.py', containing a test for
batch JSON-RPC requests.  Those were previously not tested at all.  Tests
for basic requests are not really necessary, as those are used anyway
in lots of other regtests.

The existing interface_http.py file is more about the underlying HTTP
connection, so adding a new interface file for the JSON-RPC specific
things makes sense.
2018-11-21 19:43:06 +01:00
Wladimir J. van der Laan 267793af8b
Merge #14742: Properly generate salt in rpcauth.py
6be7d14d24 Properly generate salt in rpcauth.py, update tests (Carl Dong)

Pull request description:

  Previously, when iterating over bytes of the generated salt to construct
  a hex string, only one character would be outputted when the byte is
  less than 0x10. Meaning that for a 16 byte salt, the hex string might be
  less than 32 characters and collisions would occur.

Tree-SHA512: 7038ecbbac846cd1851112396acd8a04475685f5b6f786e4e7316acba4a56cc711c275b7f52f0f2b6bc6cfdc0c0d9d39c3afeb2c0aff3a30fde516bf642fdf9f
2018-11-21 10:33:25 +01:00
Wladimir J. van der Laan afa506f6eb
Merge #14552: wallet: detecting duplicate wallet by comparing the db filename.
591203149f wallet: Create IsDatabaseLoaded function (Chun Kuan Lee)
15c93f075a wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a directory. (Chun Kuan Lee)
c456fbd8df Refactor: Move m_db pointers into BerkeleyDatabase (Russell Yanofsky)

Pull request description:

  Fix #14538

  Fix crash attempting to load the same wallet with different path strings that resolve to the same absolute path. The primary check which prevents loading the same wallet twice is:

  6b8d0a2164/src/wallet/db.cpp (L44)

  But this check is skipped if both wallet paths resolve to the same absolute path, due to caching here:

  6b8d0a2164/src/wallet/db.cpp (L467)

  Meanwhile a secondary check for duplicate wallets is not reliable because it based on a literal comparison, instead of comparison using absolute paths:

  6b8d0a2164/src/wallet/wallet.cpp (L3853)

  This PR fixes the latter check to compare the absolute path of a new wallet being loaded to absolute paths of wallets already loaded, so there should no longer be any way to load the same wallet more than once.

Tree-SHA512: 2fa01811c160b57be3b76c6b4983556a04bbce71a3f8202429987ec020664a062e897deedcd9248bc04e9baaa2fc7b464e2595dcaeff2af0818387bf1fcdbf6f
2018-11-20 15:15:59 +01:00
Carl Dong 6be7d14d24 Properly generate salt in rpcauth.py, update tests
Previously, when iterating over bytes of the generated salt to construct
a hex string, only one character would be outputted when the byte is
less than 0x10. Meaning that for a 16 byte salt, the hex string might be
less than 32 characters and collisions would occur.
2018-11-17 01:26:49 -08:00
Russell Yanofsky 65b740f92b [wallet] Restore ability to list incoming transactions by label
This change partially reverts #13075 and #14023.

Fixes #14382
2018-11-13 17:49:23 -04:00
MarcoFalke 8c59bb85f9
Merge #14720: rpc: Correctly name arguments
fa0815c300 rpc: Correctly name arguments (Jon Layton)

Pull request description:

  Consistently use the same name to describe arguments in the documentation and add a test that uses the name.

  By splitting it up, the changes are easier to potentially backport and also make review easier when we switch to `RPCHelpMan`.

  The tests should pass with or without the changes in `src`.

  Partly stolen from #14459 (More RPC help description fixes by ch4ot1c)

Tree-SHA512: 1072992b1e93ac41006613523e54a0a8004f529fcb101eb9d74d91474abb0945a5a7539f249905151b904b87448f9efc0cacbd9e052fbe2ea9111e62f3e7249c
2018-11-13 16:49:23 -05:00
Wladimir J. van der Laan f617e05c38
Merge #14679: importmulti: Don't add internal addresses to address book
7afddfa8ce importmulti: Don't add internal addresses to address book (Gregory Sanders)

Pull request description:

  Currently anything imported with `internal` will not be treated as change since checking the address book is a primary test of this.

  Added basic tests of all combinations of arguments and change identification.

  Resolves https://github.com/bitcoin/bitcoin/issues/14662

Tree-SHA512: a1f08dc624a3fadee93cc5392d50c4796b0c5eedf38e295382f71570f2066d9e978ed6e3962084b902989863fe1273a8642d8fdb094a266d69de10622a4176b0
2018-11-13 21:34:23 +01:00
Jon Layton fa0815c300
rpc: Correctly name arguments 2018-11-13 14:24:40 -05:00
MarcoFalke e0c6bb7823
Merge #14705: travis: Avoid timeout on verify-commits check
fa5a6ce102 qa: Raise ci test_runner timeout to 40 mins (MarcoFalke)
fa3df025e1 travis: Avoid timeout on verify-commits check (MarcoFalke)

Pull request description:

  The verify-commits check is too expensive to run in full (calculate Tree-SHA512 and clean-merge for every single merge commit in history) every day (the cron job runs every ~24h). Since the cron job is running every day, it is also redundant to redo most of the work on the next day.

  So, only check two days worth of commits and assume that travis checked the Tree-SHA512 and clean-merge for all other commits already. The script will still check all the signatures, since the check-result for them depends on external inputs such as current time or the public keys we got from the server.

  [Note that travis is not meant to do the verification for anyone or is meant to be trusted in any way. This check only serves as a belt-and-suspender to notify maintainers in case of a technical issue or script malfunction. But since the script is timing out for months now, its purpose is diminished right now.]

Tree-SHA512: 336c5cbcc03cdf50be96cd61412471be9078d862da8ba2054f337441e062a6067c95fbbd03912e3de6a116f3caa75fd3f01a04864d34aae1489faa3154572815
2018-11-13 12:25:25 -05:00
MarcoFalke 5d605b2745
Merge #14700: qa: Avoid race in p2p_invalid_block by waiting for the block request
fa21568208 qa: Avoid race in p2p_invalid_block by waiting for the block request (MarcoFalke)
6c787d340c tests: Make feature_block pass on centos (MarcoFalke)

Pull request description:

  This hopefully fixes #14661, which I believe is caused by a race in `send_blocks_and_test`. By setting `request_block=False` we only effectively check `node.getbestblockhash() != blocks[-1].hash` before returning and checking the debug.log. By setting `request_block=True` (the default) we make sure that we send the block, then sync with a ping before asserting on the debug.log.

  Even if this patch doesn't fix the issue, it is good cleanup: There is no reason to not wait for the blocks to be requested, since in all these cases the header gives no indication that the block is consensus invalid. So this patch makes the test also a bit stricter and more useful.

  Unrelated to this, I also include a fix that makes the tests pass on latest CentOS.

Tree-SHA512: c7abee3b7dc790a8af6c289159a7751bd962f6fa16c1537e7e21a0a0ef05b9596d1f4eb75319614603c05cb803e021314fa3596508ba443edd03046b25527e0f
2018-11-13 10:24:51 -05:00
Jonas Schnelli b60f4e3f09
Merge #13381: RPC: creates possibility to preserve labels on importprivkey
a6b5ec18f rpc: creates possibility to preserve labels on importprivkey (marcoagner)

Pull request description:

  Closes #13087.

  As discussed in the issue, this is a feature request instead of a bug report since the behaviour was as intended (i.e. label with default: `''`). With this, the old behaviour is kept while the possibility to achieve the preservation of labels, as expected in the open issue, is added.

Tree-SHA512: b33be50e1e7f62f7ddfae953177ba0926e2d848961f9fac7501c2b513322c0cb95787745d07d137488267bad1104ecfdbe800c6747f94162eb07c976835c1386
2018-11-13 14:52:01 +07:00
Wladimir J. van der Laan 47ed24cf8a
Merge #14356: fix converttopsbt permitsigdata arg, add basic test
88a79cb436 fix converttopsbt permitsigdata arg, add basic test (Gregory Sanders)

Pull request description:

  The final check for extraneous sigdata has a flipped boolean, resulting in incorrect behavior.

  Resolves https://github.com/bitcoin/bitcoin/issues/14355

Tree-SHA512: 5157a74b8ddebd7d836fba96765c4d7ed15a73d4289817353d3566a0f6803bd4bbc3f936735c517c7a83a6cbdb4052b9c61d23f6cc4ad00a6077278cd51adbd4
2018-11-12 19:14:13 +01:00
Wladimir J. van der Laan 90c0b6aca2
Merge #14494: Error if # is used in rpcpassword in conf
0385109444 Add test for rpcpassword hash error (MeshCollider)
13fe258e91 Error if rpcpassword in conf contains a hash character (MeshCollider)

Pull request description:

  Fixes #13143 now #13482 was merged

Tree-SHA512: e7d00c8df1657f6b8d0eee1e06b9ce2b1b0a2de487377699382c1b057836e1571dac313ca878b5877c862f0461ba789a50b239d2a9f34accd8a6321f126e3d2a
2018-11-12 15:23:27 +01:00
Wladimir J. van der Laan af3c8a7e9f
Merge #14693: test_node: get_mem_rss fixups
fa9ed38d57 test_node: get_mem_rss fixups (MarcoFalke)

Pull request description:

  Follow up to #14522:

  * Fix math (Memory usage increase relative to previous memory usage, not final memory usage)
  * remove `shell=True`
  * assert that the node is running
  * Make it work on BSD-like systems

Tree-SHA512: fc1b4f88173914b6cb6373655cffd781044a0c146339e3fa90da03b197faa20954567a77335965b857d29d27f32661698b6a0340f0c616f643b8c4510cd360c2
2018-11-12 15:02:19 +01:00
MarcoFalke fa5a6ce102
qa: Raise ci test_runner timeout to 40 mins 2018-11-10 13:12:40 -05:00
Pieter Wuille 16e3b17578
Merge #14689: Require a public key to be retrieved when signing a P2PKH input
6b8d86ddb8 Require a public key to be retrieved when signing a P2PKH input (Andrew Chow)

Pull request description:

  If we do not have the public key for a P2PKH input, we should not continue to attempt to sign for it.

  This fixes a problem where a PSBT with a P2PKH output would include invalid BIP 32 derivation paths that are missing the public key.

Tree-SHA512: 850d5e74c06833da937d5bf0348bd134180be7167b6f9b9cecbf09f75e3543fbad60d0abbc0b9afdfa51ce165aa36168849f24a7c5abf1e75f37ce8f9a13d127
2018-11-09 20:14:28 -08:00
Pieter Wuille b30c62d4b9
Merge #14588: Refactor PSBT signing logic to enforce invariant and fix signing bug
e13fea975d Add regression test for PSBT signing bug #14473 (Glenn Willen)
565500508a Refactor PSBTInput signing to enforce invariant (Glenn Willen)
0f5bda2bd9 Simplify arguments to SignPSBTInput (Glenn Willen)
53e6fffb8f Add bool PSBTInputSigned (Glenn Willen)
65166d4cf8 New PartiallySignedTransaction constructor from CTransction (Glenn Willen)
4f3f5cb4b1 Remove redundant txConst parameter to FillPSBT (Glenn Willen)
fe5d22bc67 More concise conversion of CDataStream to string (Glenn Willen)

Pull request description:

  As discussed in the comments on #14473, I think that bug was caused primarily by failure to adhere to the invariant that a PSBTInput always has exactly one of the two utxo fields present -- an invariant that is already enforced by PSBTInput::IsSane, but which we were temporarily suspending during signing.

  This refactor repairs the invariant, also fixing the bug. It also simplifies some other code, and removes redundant parameters from some related functions.

  fixes #14473

Tree-SHA512: cbad3428175e30f9b7bac3f600668dd1a8f9acde16b915d27a940a2fa6d5149d4fbe236d5808fd590fb20a032274c99e8cac34bef17f79a53fdf69a5948c0fd0
2018-11-09 19:43:09 -08:00
MarcoFalke fa21568208
qa: Avoid race in p2p_invalid_block by waiting for the block request 2018-11-09 15:46:58 -05:00
MarcoFalke 6c787d340c tests: Make feature_block pass on centos 2018-11-09 15:46:32 -05:00
MarcoFalke fa9ed38d57
test_node: get_mem_rss fixups 2018-11-08 18:05:09 -05:00
Andrew Chow 6b8d86ddb8 Require a public key to be retrieved when signing a P2PKH input
If we do not have the public key for a P2PKH input, we should not
continue to attempt to sign for it.
2018-11-08 10:38:43 -05:00
Gregory Sanders 7afddfa8ce importmulti: Don't add internal addresses to address book 2018-11-07 14:43:14 -05:00
practicalswift c82190cdb6 tests: Add Python dead code linter (vulture) 2018-11-07 18:09:14 +01:00
practicalswift 590a57fdec tests: Remove unused testing code 2018-11-07 18:07:49 +01:00
James O'Beirne 3d305e3b89 Send fewer spam messages in p2p_invalid_messages
Builds on travis are failing because the test node isn't
able to drop all the bad messages sent within the given
timeout. Reduce the number of bad messages we're sending
and increase the timeout to avoid failures on travis.
2018-11-06 11:20:00 -05:00
MarcoFalke 6af27b8157
Merge #14619: tests: Fix value display name in test_runner help text
5a05aa2db2 Add metavar to match var name in help text + Change wording for better readability (Martin Erlandsson)

Pull request description:

  The help text given by `test/functional/test_runner.py -h` refers to the value `n`, which is defined as `COMBINEDLOGSLEN` in the list of commands.

  To make the help text consistent, this PR changes the display name `COMBINEDLOGSLEN` to `n` by setting the argparse [`metavar`](https://docs.python.org/3/library/argparse.html#metavar) attribute. (`metavar` only changes the _displayed_ name)

  Alternatively: Do the opposite and change the help text to use `COMBINEDLOGSLEN`.

  ---

  Before PR:
  ```
  ➜  bitcoin > test/functional/test_runner.py -h | grep -A 1 combinedlogslen
    --combinedlogslen COMBINEDLOGSLEN, -c COMBINEDLOGSLEN
                          print a combined log (of length n lines) from all test nodes and test framework to the console on failure.
  ```

  After PR:
  ```
  ➜  bitcoin > test/functional/test_runner.py -h | grep -A 1 combinedlogslen
    --combinedlogslen n, -c n
                          print a combined log (of length n lines) from all test nodes and test frameworks to the console on failure.
  ```
  ---
  Also, fixed pluralization typo.

Tree-SHA512: a1124a4976d29fae1e8ecd7fa2ac523b7f05d541c611166532f44692995691a96faf797fa71582d78634f328b500cbee49c6ef296c8f1a898a57c050cc4e721d
2018-11-06 10:44:40 -05:00
Wladimir J. van der Laan cdddd17780
Merge #14658: qa: Add test to ensure node can generate all rpc help texts at runtime
bbbbb3f885 qa: Add test to ensure node can generate all help texts at runtime (MarcoFalke)

Pull request description:

  This might increase coverage, but more importantly this checks that the node doesn't crash when generating the help. (Right now the help is a static string, but in the future it might be generated at runtime)

Tree-SHA512: 0226e7c65f8a1a6fdc96c07dcf491d90559bc2355c92e9da9b1f174b09733fc349269e71da6d792f954de563a1e57c848471813eabae1a40b849a0d989520a0d
2018-11-06 11:58:39 +01:00
Wladimir J. van der Laan 024816d6cf
Merge #14522: tests: add invalid P2P message tests
d20a9fa13d tests: add tests for invalid P2P messages (James O'Beirne)
62f94d39f8 tests: add P2PConnection.send_raw_message (James O'Beirne)
5aa31f6ef2 tests: add utility to assert node memory usage hasn't increased (James O'Beirne)

Pull request description:

  - Adds `p2p_invalid_messages.py`: tests based on behavior for dealing with invalid and malformed P2P messages. Includes a test verifying that we can't DoS a node by spamming it with large invalid messages.
  - Adds `TestNode.assert_memory_usage_stable`: a context manager that allows us to ensure memory usage doesn't significantly increase on a node during some test.
  - Adds `P2PConnection.send_raw_message`: which allows us to construct and send messages with tweaked headers.

Tree-SHA512: 720a4894c1e6d8f1551b2ae710e5b06c9e4f281524623957cb01599be9afea82671dc26d6152281de0acb87720f0c53b61e2b27d40434d30e525dd9e31fa671f
2018-11-06 11:48:14 +01:00
Martin Erlandsson 5a05aa2db2 Add metavar to match var name in help text + Change wording for better readability 2018-11-06 07:54:52 +01:00
Chun Kuan Lee 15c93f075a wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a directory. 2018-11-06 08:28:02 +08:00
MeshCollider 0385109444 Add test for rpcpassword hash error 2018-11-06 12:35:07 +13:00
Gregory Sanders 6c5355e43d example_test.py: fixup coinbase height argument, derive number clearly 2018-11-05 13:18:24 -05:00
MarcoFalke bbbbb3f885
qa: Add test to ensure node can generate all help texts at runtime 2018-11-05 11:13:32 -05:00
MarcoFalke 6b8d0a2164
Merge #14632: Tests: Fix a comment
086fc83571 Tests: Fix a comment (fridokus)

Pull request description:

  Fix a comment that was false

Tree-SHA512: 945aa38229545e026e18c3abf53a4fbe6ec36413ce690fff7a1dd89b6e102d2b574524092e0ddf06cace82f3c040c59221b9b942be1203525814d2fbd50aaa0b
2018-11-05 10:12:52 -05:00
Wladimir J. van der Laan dac2caa371
Merge #14060: ZMQ: add options to configure outbound message high water mark, aka SNDHWM
a4edb168b6 ZMQ: add options to configure outbound message high water mark, aka SNDHWM (mruddy)

Pull request description:

  ZMQ: add options to configure outbound message high water mark, aka SNDHWM

  This is my attempt at https://github.com/bitcoin/bitcoin/pull/13315

Tree-SHA512: a4cc3bcf179776899261a97c8c4f31f35d1d8950fd71a09a79c5c064879b38e600b26824c89c4091d941502ed5b0255390882f7d44baf9e6dc49d685a86e8edb
2018-11-05 13:45:41 +01:00
Wladimir J. van der Laan 46eb2755d4
Merge #14350: Add WalletLocation class
65f3672f3b wallet: Refactor to use WalletLocation (João Barbosa)
01a4c095c8 wallet: Add WalletLocation utility class (João Barbosa)

Pull request description:

  Advantages of this change:
   - avoid resolving wallet absolute path and name repetitively and in multiple places;
   - avoid calling `GetWalletDir` in multiple places;
   - extract these details from the actual wallet implementation.

  The `WalletLocation` class can be a way to represent a wallet not yet loaded that exists in the wallet directory.

Tree-SHA512: 71ec09786e038499710e7acafe92d66ab9883fc894964e267443ae9c10a6872a10995c3987a169c436a4e793dae96b28fb97bd7f78483c4b72ac930fa23f8686
2018-11-05 13:17:03 +01:00
Wladimir J. van der Laan bccb4d29a8
Merge #14555: Move util files to directory
2068f089c8 scripted-diff: Move util files to separate directory. (Jim Posen)

Pull request description:

  As discussed [here](https://github.com/bitcoin/bitcoin/pull/14074#issuecomment-429090584), this establishes a `util/` directory to introduce more organizational structure and have a clear place for new util files. It's really not scary to review, it's just one big scripted diff.

Tree-SHA512: 39cf15480d7d35e987b6088d52a857a2d5b1802e36c6b815eb42718d80cd95e669757af9bcc7c04426cd8523662cb1050b8da1e2377d3730672820ed298b894b
2018-11-05 11:34:29 +01:00
Jim Posen 2068f089c8 scripted-diff: Move util files to separate directory.
-BEGIN VERIFY SCRIPT-
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmemory.h src/util/memory.h
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp

sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')

sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h
sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h

sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am
sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am

sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh
sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh
sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj
-END VERIFY SCRIPT-
2018-11-04 22:46:07 -08:00
MarcoFalke b74078868b
Merge #14410: rpcwallet: 'ischange' field for 'getaddressinfo' RPC
14a06525b2 tests: add test for 'getaddressinfo' RPC result 'ischange' field (whythat)
93d1aa9abc rpcwallet: add 'ischange' field to 'getaddressinfo' response (whythat)

Pull request description:

  Implementation of proposal in #14396.

  This introduces `CWallet::IsChange(CScript&)` method and replaces original `CWallet::IsChange(CTxOut&)` method with overloaded version that delegates to the new method with *txout*'s `scriptPubKey`. In this way `TODO` note from the original method can still be addressed in a single place.

Tree-SHA512: ef5dbc82d76b4b9b2fa6a70abc3385a677c55021f79e187ee2f392ee32bc6b406191f4129acae5c17b0206e72b6712e7e0cad574a4bbd966871c2e656c45e041
2018-11-04 17:23:11 -05:00
MarcoFalke 750415701c
Merge #14630: test_runner: Remove travis specific code
fa43626611 test_runner: Remove travis specific code (MarcoFalke)

Pull request description:

  The tests are no longer run on travis, but in a docker, developer machines or a windows vm.

  The code was essentially dead for months now. Fix that by explicitly passing in `--ci` to the test runner on our docker and appveyor windows vm.

Tree-SHA512: 5d48693c03e8eb27536658ccf9ba738fe93a72abd4b72c80caac084b5b2cdffa77a1031a671eeefe70b71d63500f55917803d4be54d01849722afdccb700a9e6
2018-11-02 15:05:03 -04:00
MarcoFalke c34c821e4c
Merge #14631: [tests] Move deterministic address import to setup_nodes
3fd7e76f6d [tests] Move deterministic address import to setup_nodes (John Newbery)

Pull request description:

  This requires a small changes to a few tests, but means that
  deterministic addresses will always be imported (unless setup_nodes
  behaviour is explicitly overridden).

  Tidies up the way we import deterministic addresses, requested in review comment here: https://github.com/bitcoin/bitcoin/pull/14468#discussion_r225594586.

Tree-SHA512: 2b32edf500e286c463398487ab1153116a1dc90f64a53614716373311abdc83d8a251fdd8f42d1146b56e308664deaf62952113f66e98bc37f23968096d1a961
2018-11-02 11:41:39 -04:00
MarcoFalke fa43626611
test_runner: Remove travis specific code 2018-11-01 18:03:26 -04:00
Glenn Willen e13fea975d Add regression test for PSBT signing bug #14473 2018-11-01 12:14:21 -07:00
James O'Beirne d20a9fa13d tests: add tests for invalid P2P messages
E.g., ensure that we can't DoS a node by sending it a bunch of large,
unrecognized messages.
2018-11-01 14:52:49 -04:00
James O'Beirne 62f94d39f8 tests: add P2PConnection.send_raw_message 2018-11-01 14:52:49 -04:00
James O'Beirne 5aa31f6ef2 tests: add utility to assert node memory usage hasn't increased
Adds a utility to get resident set size memory usage for a test
node and a context manager that allows assertions based upon
maximum memory use increase.
2018-11-01 14:52:46 -04:00
Wladimir J. van der Laan 51e5ef3971
Merge #14377: check that a separator is found for psbt inputs, outputs, and global map
4fb3388db9 check that a separator is found for psbt inputs, outputs, and global map (Andrew Chow)

Pull request description:

  Currently it doesn't make sure that a separator was found so PSBTs missing a trailing separator would still pass. This fixes that and adds a test case for it.

  It really only makes sense to check for the separator for the output maps as if an input or global map was missing a separator, the fields following it would be interpreted as belonging to the previous input or global map. However I have added the check for those two anyways to be consistent.

Tree-SHA512: 50c0c08e201ba02494b369a4d36ddb73e6634eb5a4e4e201c4ef38fd2dbeea2c642b8a04d50c91615da61ecbfade37309e47431368f4b1064539c42015766b50
2018-11-01 17:55:39 +01:00
John Newbery 3fd7e76f6d [tests] Move deterministic address import to setup_nodes
This requires a small changes to a few tests, but means that
deterministic addresses will always be imported (unless setup_nodes
behaviour is explicitly overridden).
2018-11-01 12:53:49 -04:00
fridokus 086fc83571 Tests: Fix a comment 2018-11-01 17:26:42 +01:00
Wladimir J. van der Laan f6df989842
Merge #14197: [psbt] Convert non-witness UTXOs to witness if witness sig created
862d159d63 Add test for conversion from non-witness to witness UTXO (Pieter Wuille)
f8c1714634 Convert non-witness UTXOs to witness if witness sig created (Andrew Chow)

Pull request description:

  If a witness signature was created when a non-witness UTXO is used, convert the non-witness UTXO to a witness one.

  Port of #14196 to master.

Tree-SHA512: 2235eeb008ffa48e821628032d689e4a83bff6c29b93fa050ab2ee492b0e67b3a30f29a680d4a0e574e05c3a2f9edf0005e161fbe25b7aef2acd034a2424e2f2
2018-11-01 16:09:38 +01:00