aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-07-05Merge #13467: [Tests] Make p2p_segwit easier to debugWladimir J. van der Laan
e3aab295e [tests] p2p_segwit: sync_blocks in subtest wrapper. (John Newbery) 55e805085 [tests] p2p_segwit: remove unnecessary arguments from subtests. (John Newbery) 25711c269 [tests] p2p_segwit: log and assert segwit status in subtest wrapper. (John Newbery) 6839863d5 [tests] p2p_segwit: Make sure each subtest leaves utxos for the next. (John Newbery) bfe32734d [tests] p2p_segwit: wrap subtests with subtest wrapper. (John Newbery) 2af4e398d [tests] p2p_segwit: re-order function definitions. (John Newbery) 94a0134a4 [tests] p2p_segwit: standardise comments/docstrings. (John Newbery) f7c7f8ecf [tests] p2p_segwit: Fix flake8 warnings. (John Newbery) Pull request description: `p2p_segwit.py` is a very long test, composed of multiple subtests. When it fails it's difficult to debug for a couple of reasons: - Control flow jumps between different methods in the test class, so it's a little difficult to follow the code. - state may be carried forward unintentionally from one subtest to the next. Improve that by wrapping the subtests with a `@subtest` decorator which: - logs progress - asserts state after each subtest As usual, I've also included a few commits which generally tidy up the test and improve style. Tree-SHA512: 3650602b3ce9823dc968cc5f2e716757feadc3dbedb3605eb79bb3df91a6db8ae53431f253b440da690e3a8e9d76de84fad4368a2663aeb40e6b9427cf948870
2018-06-30Merge #13522: [tests] Fix p2p_sendheaders raceMarcoFalke
75848bcf40 [tests] Fix p2p_sendheaders race (John Newbery) Pull request description: p2p_sendheaders has a race in part 1.3. part 1.2 sends a block to the node over the 'test_node' connection, but doesn't wait for an inv to be received on the 'inv_node' connection. If we get to part 1.3 before that inv has been received, then the subsequent call to check_last_inv_announcement could fail. Tree-SHA512: ba9baffb3a9c0d379259190c737a7a4ad2e1133005a5b026af4f6b67a2978e24db39289551ad29134151879593ef5472be7e569a3557c0740fb51f5c56263d9a
2018-06-29[tests] p2p_segwit: sync_blocks in subtest wrapper.John Newbery
2018-06-29[tests] p2p_segwit: remove unnecessary arguments from subtests.John Newbery
2018-06-29[tests] p2p_segwit: log and assert segwit status in subtest wrapper.John Newbery
2018-06-29[tests] p2p_segwit: Make sure each subtest leaves utxos for the next.John Newbery
2018-06-29[tests] p2p_segwit: wrap subtests with subtest wrapper.John Newbery
The subtest wrapper logs the name of the subtest.
2018-06-29[tests] p2p_segwit: re-order function definitions.John Newbery
This re-orders the defintions in p2p_segwit so subtests are defined in the order that they're called.
2018-06-29[tests] p2p_segwit: standardise comments/docstrings.John Newbery
2018-06-29[tests] p2p_segwit: Fix flake8 warnings.John Newbery
2018-06-29Merge #13517: qa: Remove need to handle the network thread in testsWladimir J. van der Laan
fa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd qa: Avoid start/stop of the network thread mid-test (MarcoFalke) Pull request description: This simplifies test writing by removing the need to handle the network thread in tests. E.g. start thread, join thread, restart thread mid-test, adding p2p connections at the "right" time, ... Tree-SHA512: 533642f12fef5496f1933855edcdab1a7ed901d088d34911749cd0f9e044c8a6cb1f89985ac3a7f41a512943663e4e270a61978f6f072143ae050cd102d4eab8
2018-06-30Merge #13545: tests: Fix test case streams_serializedata_xor. Remove Boost ↵MarcoFalke
dependency. 962d8eed5b Remove boost dependency (boost/assign/std/vector.hpp) (practicalswift) c6fd0df4ef Fix incorrect tests (practicalswift) Pull request description: * Fix test case `streams_serializedata_xor`. * Remove Boost dependency. Tree-SHA512: 609c4ced1b6a8b86f6a37e4220535f1b3c9f2e80949cd034ecc069a94c55c05cd514f2e132fe7f715161ee29811a0fadb6903635c507411d8dc3e7efe864edeb
2018-06-29Merge #13535: [qa] wallet_basic: Specify minimum required amount for listunspentMarcoFalke
fa103a5d5e [qa] wallet_basic: Specify minimum required amount for listunspent (MarcoFalke) Pull request description: A value less than that would fail the tests later on anyway: ``` File "./test/functional/wallet_basic.py", line 250, in run_test self.nodes[1].sendrawtransaction(signed_raw_tx['hex']) test_framework.authproxy.JSONRPCException: bad-txns-in-belowout, value in (1.00) < value out (49.998) (code 16) (-26) Tree-SHA512: 7e72ad02b5623bc078610da06c34721836822a920a4e85b12a1e0f339e3205cdc11d39763197770e649fb73376f922ff91a8f244b465195e50a6798658e04f80
2018-06-27Remove boost dependency (boost/assign/std/vector.hpp)practicalswift
2018-06-26Merge #13498: [wallet] Fixups from account API deprecationPieter Wuille
df10f07db1 [wallet] Don't use accounts when checking balance in sendmany (John Newbery) e209184101 [wallet] deprecate sendfrom RPC method. (John Newbery) Pull request description: A couple of fixups from the accounts API deprecation PR (#12953): - properly deprecate `sendfrom` - don't use accounts when calculating balance in `sendmany` (unless the `-deprecatedrpc=accounts` flag is being used) Tree-SHA512: 1befde055067438c4c3391bbff1aaed0e6249efd708c567db3f1faad40a0f28e64f95e5bad0679ae826d24a0239e4bc8a1c392dc93e2e7502343a7f6b1d1845c
2018-06-25qa: Avoid start/stop of the network thread mid-testMarcoFalke
2018-06-25[qa] wallet_basic: Specify minimum required amount for listunspentMarcoFalke
2018-06-24Merge #13160: wallet: Unlock spent outputsWladimir J. van der Laan
fd9b3a71824e33728f267e6f288b6224ad1047e1 test: Output should be unlocked when spent (João Barbosa) 54c3bb4cf805ccee91efb9f8cdadea87e0797989 wallet: Unlock spent outputs (João Barbosa) Pull request description: Fixes #12738. Tree-SHA512: 2c1694727aea0c658d07566c7d11d7afe91218053f84d568fac97413348fa5a977243d6cdeebd1c6550816489e35cb3a31667c8354d9b350de99f979d641d605
2018-06-24Merge #13496: Test: Harden lint-filenames.shWladimir J. van der Laan
927e1150bc207181f7d5b0948e87d04b737a1c27 Test: Harden lint-filenames.sh (wodry) Pull request description: - This fixes that only files with lower case file name suffix where found before, which contradicted the Regex to find uppercase characters in file names (including suffixes I guess). - `--full-name` switch was added to git ls-files, to define that the found file always includes it's full path in the git project. - since we know now that the file name includes the full path, we can harden the Regex to exclude the secp256k1 and univalue sub folders. - use backslash line break to make code easier to read and avoid too long line. Tree-SHA512: 9b55fe4965ae2084112b9f8a81bf9c657756c2cb5004986e7b6102a76adaf62c7d7a53257d9f13c5d8a1c75870b52c744d13830e3edd454a099e810357c914e5
2018-06-24Merge #13510: Scripts and tools: Obsolete #!/bin/bash shebangWladimir J. van der Laan
000000035b20402dea3e8168165cd4eefdc97539 Obsolete #!/bin/bash shebang (DesWurstes) Pull request description: > `#!/bin/bash` assumes it is always installed to `/bin/` which can cause issues > `#!/usr/bin/env bash` searches the user's `PATH` to find the `bash` binary Details: https://github.com/dylanaraps/pure-bash-bible#obsolete-syntax I'm open to comments: Should I also fix `#!/bin/sh`? Tree-SHA512: b47bb4828116aa119f1899c68fee081270d51a898535490b9c616bf0f3660ad953f29c361eafc759bc64cdd54ee6eeecb2d79e9fdb5291a996a515c719805476
2018-06-23Merge #13512: [qa] mininode: Expose connection state through is_connectedMarcoFalke
fa1eac9cdb [qa] mininode: Expose connection state through is_connected (MarcoFalke) Pull request description: This gets rid of some non-type safe string comparisons and access to members that are implementation details of `class P2PConnection(asyncore.dispatcher)`. Such refactoring is required to replace the deprecated asyncore with something more sane. Changes: * Get rid of non-enum member `state` and replace is with bool `connected` * Get rid of confusing argument `pushbuf` and literally just push to the buffer at the call site Tree-SHA512: 09074c7e5ed251a2e0509ef205ab82f89887c1e1fa1cc6efc1db60d196eb2403788a4987df8809fd06d80ef652e614c5d3c3fdef70096fc5815102243388288d
2018-06-22[qa] mininode: Expose connection state through is_connectedMarcoFalke
2018-06-22[tests] Fix p2p_sendheaders raceJohn Newbery
p2p_sendheaders has a race in part 1.3. part 1.2 sends a block to the node over the 'test_node' connection, but doesn't wait for an inv to be received on the 'inv_node' connection. If we get to part 1.3 before that inv has been received, then the subsequent call to check_last_inv_announcement could fail.
2018-06-21Merge #13111: Add unloadwallet RPCJonas Schnelli
fe65bdec2 bugfix: Delete walletView in WalletFrame::removeWallet (João Barbosa) 0b82bac76 bugfix: Remove dangling wallet env instance (João Barbosa) 0ee77b207 ui: Support wallets unloaded dynamically (João Barbosa) 9f9b50d5f doc: Add release notes for unloadwallet RPC (João Barbosa) ccbf7ae74 test: Wallet methods are disabled when no wallet is loaded (João Barbosa) 4940a20a4 test: Add functional tests for unloadwallet RPC (João Barbosa) 6608c369b rpc: Add unloadwallet RPC (João Barbosa) 537efe19e rpc: Extract GetWalletNameFromJSONRPCRequest from GetWalletForJSONRPCRequest (João Barbosa) Pull request description: This patch adds wallet unload feature via RPC. It also adds UI support for unloaded wallets. Tree-SHA512: 7c7f9f32f7a2266d2df574aa6b95f993c3dc82736f93304562122beb8756fb28cd22d03866b48f493c747441f22d30e196b098dec435cc25e035633f090351ea
2018-06-20Obsolete #!/bin/bash shebangDesWurstes
2018-06-18[wallet] deprecate sendfrom RPC method.John Newbery
2018-06-18Test: Harden lint-filenames.shwodry
2018-06-18bugfix: Remove dangling wallet env instanceJoão Barbosa
2018-06-18test: Wallet methods are disabled when no wallet is loadedJoão Barbosa
2018-06-18test: Add functional tests for unloadwallet RPCJoão Barbosa
2018-06-18Follow-up to #13454: Fix broken build by exporting LC_ALL=Cpracticalswift
2018-06-18Merge #13454: Make sure LC_ALL=C is set in all shell scriptsWladimir J. van der Laan
47776a958b08382d76d69b5df7beed807af168b3 Add linter: Make sure all shell scripts opt out of locale dependence using "export LC_ALL=C" (practicalswift) 3352da8da1243c03fc83ba678d2f5d193bd5a0c2 Add "export LC_ALL=C" to all shell scripts (practicalswift) Pull request description: ~~Make sure `LC_ALL=C` is set when using `grep` range expressions.~~ Make sure `LC_ALL=C` is set in all shell scripts. From the `grep(1)` documentation: > Within a bracket expression, a range expression consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, inclusive, using the locale's collating sequence and character set. For example, in the default C locale, `[a-d]` is equivalent to `[abcd]`. Many locales sort characters in dictionary order, and in these locales `[a-d]` is typically not equivalent to `[abcd]`; it might be equivalent to `[aBbCcDd]`, for example. To obtain the traditional interpretation of bracket expressions, you can use the C locale by setting the `LC_ALL` environment variable to the value C. Context: [Locale issue found when reviewing #13450](https://github.com/bitcoin/bitcoin/pull/13450/files#r194877736) Tree-SHA512: fd74d2612998f9b49ef9be24410e505d8c842716f84d085157fc7f9799d40e8a7b4969de783afcf99b7fae4f91bbb4559651f7dd6578a6a081a50bdea29f0909
2018-06-16Merge #13448: Add linter: Make sure we explicitly open all text files using ↵Wladimir J. van der Laan
UTF-8 encoding in Python c8176b3cc7556d7bcec39a55ae4d6ba16453baaa Add linter: Make sure we explicitly open all text files using UTF-8 or ASCII encoding in Python (practicalswift) 634bd970013eca90f4b4c1f9044eec8c97ba62c2 Explicitly specify encoding when opening text files in Python code (practicalswift) Pull request description: Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python. As requested by @laanwj in #13440. Tree-SHA512: 1651c00fe220ceb273324abd6703aee504029b96c7ef0e3029145901762c733c9b9d24927da281394fd4681a5bff774336c04eed01fafea997bb32192c334c06
2018-06-14Add linter: Enforce the source code file naming convention described in the ↵practicalswift
developer notes
2018-06-14Merge #13451: rpc: expose CBlockIndex::nTx in getblock(header)Wladimir J. van der Laan
86edf4a2a502416ba8d6cebbce61030992f7ff6f expose CBlockIndex::nTx in getblock(header) (Gregory Sanders) Pull request description: Recent publication of a weakness in Bitcoin's merkle tree construction demonstrates many SPV applications vulnerable to an expensive to pull off yet still plausible attack: https://bitslog.wordpress.com/2018/06/09/leaf-node-weakness-in-bitcoin-merkle-tree-design/ Including the coinbase in the txoutproof seems the most effective fix, however results in a significant efficiency downgrade. Transactors will not even know a priori what the size of their proof will be within a couple orders of magnitude, unless they use the mid-state of SHA2 as detailed in the blog post. Some applications, like Elements blockchain platform that take SPV-style proofs have optional access to a bitcoind to verify these proofs of inclusion and check depth in the chain. Returning `CBlockIndex::nTx` would allow an extremely easy and compact way of checking the depth of the tree, with no additional overhead to the codebase, and works with pruned nodes. `getblockheader` is arguably not the place for it, but as mentioned before, is a natural workflow for us checking depth of a block in a possibly pruned node. We should also ensure that `verifytxoutproof` ends up validating this depth fact as well, but left this for another PR. Tree-SHA512: af4cf48e704c6088f8da06a477fda1aaa6f8770cee9b876c4465d1075966d6a95831a88817673fe5a0d6bbcdc1ffcbc1892e2be0d838c60fc6958d33eacdcc14
2018-06-14Add linter: Make sure all shell scripts opt out of locale dependence using ↵practicalswift
"export LC_ALL=C"
2018-06-14Add "export LC_ALL=C" to all shell scriptspracticalswift
2018-06-13Merge #13350: [tests] Add logging to provide anchor points when debugging ↵MarcoFalke
p2p_sendheaders 2ce81867b2 [tests] Add logging to provide anchor points when debugging failures. (Lowell Manners) Pull request description: refs #12453 Tree-SHA512: 0ad432bd848723a5b813df4d35fcd8c81d152f042499c8340a9a2a9b7918d6e785efbf9f07b63b6c0253a949044cebdb51802971c09fb8dde0efa5169f34ef20
2018-06-13expose CBlockIndex::nTx in getblock(header)Gregory Sanders
2018-06-12Add linter: Make sure we explicitly open all text files using UTF-8 or ASCII ↵practicalswift
encoding in Python
2018-06-12Explicitly specify encoding when opening text files in Python codepracticalswift
2018-06-12Merge #13120: policy: Treat segwit as always activeWladimir J. van der Laan
fa7a6cf1b36284db70e941bd2915fd6edbb0f9d6 policy: Treat segwit as always active (MarcoFalke) Pull request description: Now that segwit is active for a long time, there is no need to reject transactions with the reason that segwit hasn't activated. Strictly speaking, this is a bug fix, because with the release of 0.16, we create segwit transactions in our wallet by default without checking if they are allowed by local policy. More broadly, this simplifies the code as if "premature witness" was always set to true with the corresponding command line args. Tree-SHA512: 484c26aa3a66faba6b41e8554a91a29bfc15fbf6caae3d5363a3966283143189c4bd5333a610b0669c1238f75620691264e73f6b9f1161cdacf7574d946436da
2018-06-12Merge #13440: qa: Log as utf-8Wladimir J. van der Laan
fa8071a0985700a4641ce77dac2cb2fa285d3afe qa: Log as utf-8 (MarcoFalke) Pull request description: Explicitly read and write the log files with utf-8 as encoding Tree-SHA512: ca28f37f34a09845c736ff6c4c21733c3c39584f52c81e48ff25e5e35979c317d0989862b2b93acc7e359fbcc20b99533365455830b2ddb41eb4d8c17314534e
2018-06-11qa: Log as utf-8MarcoFalke
2018-06-11Merge #13230: Simplify include analysis by enforcing the developer guide's ↵Wladimir J. van der Laan
include syntax 16e3cd380af570fb2f656e0344bab88829a4bcda Clarify include recommendation (practicalswift) 6d10f43738d58bf623975e3124fd5735aac7d3e1 Enforce the use of bracket syntax includes ("#include <foo.h>") (practicalswift) 906bee8e5f474f8718d02e6f1938f20dcfe3d2cc Use bracket syntax includes ("#include <foo.h>") (practicalswift) Pull request description: When analysing includes in the project it is often assumed that the preferred bracket include syntax (`#include <foo.h>`) mentioned in `developer-docs.md` is used consistently. @sipa:s excellent circular dependencies script [`circular-dependencies.py`](https://github.com/sipa/bitcoin/blob/50c69b78011c1bc55885ebfd216db60ed490ebea/contrib/devtools/circular-dependencies.py) (#13228) is an example of a script making this reasonable assumption. This PR enables automatic Travis checking of the include syntax making sure that the bracket syntax includes (`#include <foo.h>`) is used consistently. Tree-SHA512: a414921aabe8e487ebed42f3f1cbd02fecd1add385065c1f2244cd602c31889e61fea5a801507ec501ef9bd309b05d3c999f915cec1c2b44f085bb0d2835c182
2018-06-11Merge #13060: [wallet] [rpc] Remove getlabeladdress RPCWladimir J. van der Laan
67e0e04140b3dfac12d628cee391d40b5fac5cfa [wallet] [docs] Update release notes for removing `getlabeladdress` (John Newbery) 81608178cff793ee205a4f70481c76d34c5448a4 [wallet] [rpc] Remove getlabeladdress RPC (John Newbery) Pull request description: labels are associated with addresses (rather than addresses being associated with labels, as was the case with accounts). The getlabeladdress does not make sense in this model, so remove it. getaccountaddress is still supported for one release as the accounts API is deprecated. Tree-SHA512: 7f45d0456248ebcc4e54dd34e2578a09a8ea8e4fceda75238ccea9d731dc99a3f3c0519b18a9739de17d2e6e59c9c2259ba67c9ae2e3cb2a40ddb14b9193fe29
2018-06-08qa: Remove portseed_offset from test runnerMarcoFalke
2018-06-07Merge #13041: build: Add linter checking for accidental introduction of ↵Wladimir J. van der Laan
locale dependence 698cfd081144845f6246171b8a2a0cfa8daaecdb docs: Mention lint-locale-dependence.sh in developer-notes.md (practicalswift) 0a4ea2f4589961868ab4d25e0277485c31938e20 build: Add linter for checking accidental locale dependence (practicalswift) Pull request description: This linter will check for code accidentally introducing locale dependencies. Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. We should avoid using locale dependent functions if possible. Context: https://github.com/bitcoin/bitcoin/pull/12881#issuecomment-378564722 Example output: ``` $ contrib/devtools/lint-locale-dependence.sh The locale dependent function tolower(...) appears to be used: src/init.cpp: if (s[0] == '0' && std::tolower(s[1]) == 'x') { Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. Please avoid using locale dependent functions if possible. Advice not applicable in this specific case? Add an exception by updating the ignore list in contrib/devtools/lint-locale-dependence.sh ``` **Note to reviewers:** What is the most appropriate `LOCALE_DEPENDENT_FUNCTIONS` function list? What should be added or removed? Tree-SHA512: 14e448828804bb02bf59070647e38b52fce120c700c903a4a8472769a2cee5dd529bd3fc182386993cb8720482cf4250b63a0a477db61b941ae4babe5c65025f
2018-06-06lint: Add linter to error on #include <*.cpp>Ben Woosley
Files should depend on one another by interface, not by implementation. This checks for quoted includes as well. With practicalswift
2018-06-06Enforce the use of bracket syntax includes ("#include <foo.h>")practicalswift