aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-04-27Merge bitcoin/bitcoin#24739: test: Fix intermittent test failure in ↵MacroFake
wallet_listreceivedby.py fa1f6df21ef3145d316bf891f268dd06efd6b9ba test: Fix intermittent test failure in wallet_listreceivedby.py (MarcoFalke) Pull request description: * Remove not needed "Generate block to get out of IBD" * Sync blocks where possible to avoid incoming blocks on the p2p `msghand` thread while blocks are mined in the RPC thread. See https://github.com/bitcoin/bitcoin/issues/24730 for discussion. Top commit has no ACKs. Tree-SHA512: eca0242e7793886535555fec62f7acd4c0955bf26fab78725b4fe53f84f0b118cb12c9ee35627503fc68b83c3a228842e861fab89aab1226e08e18596357aaae
2022-04-26Merge bitcoin/bitcoin#21726: Improve Indices on pruned nodes via prune blockersfanquake
71c3f0356c01521a95c64fba1e7375aea6286bb0 move-only: Rename index + pruning functional test (Fabian Jahr) de08932efa953e9a237cbf879460488ad8947411 test: Update test for indices on pruned nodes (Fabian Jahr) 825d19839bf71245306d4c8edde040e5941caa46 Index: Allow coinstatsindex with pruning enabled (Fabian Jahr) f08c9fb0c6a799e3cb75ca5f763a746471625beb Index: Use prune locks for blockfilterindex (Fabian Jahr) 2561823531c25e1510c107eb41de944b00444ce0 blockstorage: Add prune locks to BlockManager (Fabian Jahr) 231fc7b035481f748159968353c1cab81354e843 refactor: Introduce GetFirstStoredBlock helper function (Fabian Jahr) Pull request description: # Motivation The main motivation of this change and only behavior change noticeable by user is to allow running `coinstatsindex` on pruned nodes as has been requested [here for example](https://twitter.com/benthecarman/status/1388170854140452870?s=20). # Background `coinstatsindex` on pruned nodes can be enabled in a much simpler than it is done here but it comes with downside. The ability to run `blockfilterindex`on pruned nodes was added in #15946 but it also added the `blockfilterindex` as a dependency to `validation` and it introduced two new circular dependencies. Enabling `coinstatsindex` on pruned nodes in a similar way would add it as a dependency as well and introduce another circular dependency. Instead, this PR introduces a `m_prune_blockers` map to `BlockManager` as a flexible approach to block pruning. Entities like `blockfilterindex`, for example, can add a key and a height to block pruning over that height. These entities need to update that value to allow more pruning when they are ready. # Alternative approach Upon completing the first draft of this PR I found #19463 as an alternative that follows the same but follows a very different approach. I am listing the main differences here as I see them: - Usage of globals - Blocks pruning with a start and a stop height - Can persist blockers across restarts - Blockers can be set/unset via RPCs Personally, I don't think any of these are necessary to be added here but if the general approach or specific features are more appealing to reviewers I am happy to change to a solution based on that PR or port over specific parts of it here. ACKs for top commit: mzumsande: Code review ACK 71c3f0356c01521a95c64fba1e7375aea6286bb0 ryanofsky: Code review ACK 71c3f0356c01521a95c64fba1e7375aea6286bb0. Changes since last review: just tweaking comments and asserts, and rebasing w0xlt: tACK https://github.com/bitcoin/bitcoin/pull/21726/commits/71c3f0356c01521a95c64fba1e7375aea6286bb0 on signet. Tree-SHA512: de7efda08b44aa31013fbebc47a02cd2de32db170b570f9643e1f013fee0e8e7ca3068952d1acc6e5e74a70910735c5f263437981ad73df841ad945b52d36b71
2022-04-26Merge bitcoin/bitcoin#24644: wallet: add tracepoints and algorithm ↵fanquake
information to coin selection ab5af9ca7293239ffc24ea7e23159b8184543f94 test: Add test for coinselection tracepoints (Andrew Chow) ca02b68e8a7147f80cbe84b0742908b0b0faa04d doc: document coin selection tracepoints (Andrew Chow) 8e3f39e4fa2d8c63bc697c9ebd303965fcccea55 wallet: Add some tracepoints for coin selection (Andrew Chow) 15b58383d0029c4ae7b487e03cd451e1580eb91d wallet: compute waste for SelectionResults of preset inputs (Andrew Chow) 912f1ed181161b0365776cd490b63137aaad708a wallet: track which coin selection algorithm produced a SelectionResult (Andrew Chow) Pull request description: Tracepoints can be useful for coin selection as they would allow us to observe what is being selected, selection parameters, and calculation results. So this PR adds 4 new tracepoints: 1. After `SelectCoins` returns in order to observe the `SelectionResult` 2. After the first `CreateTransactionInternal` to observe the created transaction 3. Prior to the second `CreateTransactionInternal` to notify that the optimistic avoid partial spends selection is occurring 4. After the second `CreateTransactionInternal` to observe the created transaction and inform which solution is being used. This PR also adds an algorithm enum to `SelectionResult` so that the first tracepoint will be able to report which algorithm was used to produce that result. The primary use case for these tracepoints is in running coin selection simulations. The script I use to run these simulations use these tracepoints in order to gather data on the algorithm used and the calculated waste. ACKs for top commit: jb55: crACK ab5af9ca7293239ffc24ea7e23159b8184543f94 josibake: crACK https://github.com/bitcoin/bitcoin/pull/24644/commits/ab5af9ca7293239ffc24ea7e23159b8184543f94 0xB10C: ACK ab5af9ca7293239ffc24ea7e23159b8184543f94. Code reviewed, ran the `interface_usdt_coinselection.py` test, and tested with the above bpftrace script (updated `%d` -> `%ld` where necessary, ty achow101). Tree-SHA512: a4bf7a910cdf464622f2f3b5d44c15b891f24852df6e7f8c5b177fe3d8aaa4a1164593a24c3960eb22b16544fa7140e5c745345367b9e291b78395084c0ac8ff
2022-04-26Merge bitcoin/bitcoin#24789: init, index: disallow indexes when running ↵fanquake
reindex-chainstate dac44fc06ff9938d070aa5221d106a7f31da9d81 init: disallow reindex-chainstate with optional indexes (Martin Zumsande) 62e14285f95d4ecb9528813acca975640dd7c598 doc: Add note that -reindex will rebuild optional indexes (Martin Zumsande) Pull request description: When started together with `-reindex-chainstate`, currently coinstatsindex gets corrupted and the blockfilterindex flatfiles duplicated. See the OP of #24630 for more a more detailed explanation on why this happens. This is an alternative to #24630 which does not wipe and rebuild the indexes but returns an `InitError` when they are activated, thus requiring the user to deactivate them temporarily until the `-reindex-chainstate` run is finished. This also disallows `-reindex-chainstate` in combination with `-txindex`, which is not leading to corruption, but currently still rebuilds the index unnecessarily and unexpectedly. As a long-term goal, it would be desirable to have the indexes tolerate `reindex-chainstate` by ignoring their `BlockConnected` notifications (there is discussion in #24630 about this) or possibly move `reindex-chainstate` option into a `bitcoin-chainstate` executable, which could also solve the problem. But these would be larger projects - until then, it might be better to disallow the interaction than having corrupted indexes. The first commit adjusts the `-reindex` doc to mention that this option does rebuild all active indexes. ACKs for top commit: ryanofsky: Code review ACK dac44fc06ff9938d070aa5221d106a7f31da9d81. Just fixed IsArgSet call and edited error messages since last review Tree-SHA512: c1abf7d350648ae227c3fd6c95d9a54c3bac9de70915275dea1c87cca6d9a76a056c0e306d95ef8cfe4df1f8525b418e0e7a4f52ded3be464041c0dc297f8930
2022-04-25move-only: Rename index + pruning functional testFabian Jahr
2022-04-25test: Update test for indices on pruned nodesFabian Jahr
2022-04-25Index: Allow coinstatsindex with pruning enabledFabian Jahr
2022-04-25Index: Use prune locks for blockfilterindexFabian Jahr
Prior to this change blocks could be pruned up to the last block before the blockfilterindex current best block.
2022-04-25Merge bitcoin/bitcoin#24856: lint: Converting lint-assertions.sh to ↵laanwj
lint-assertions.py 172c2333f03aecb4c347c791537e13c296adbde2 Porting lint-assertions.sh to lint-assertions.py (hiago) Pull request description: This PR is converting `test/lint/lint-assertions.sh` to `test/lint/lint-assertions.py`. It's an item of #24783. ACKs for top commit: laanwj: Tested ACK 172c2333f03aecb4c347c791537e13c296adbde2 Tree-SHA512: 94d5b03acfeaf2303fad95d489d6c3aa7bd655889ddaa807cc97e0613b8eb8f5ef094feee2a98d974606890deb554e76490a5c523d64eb5bc55afa6a43221aae
2022-04-25Merge bitcoin/bitcoin#24915: lint: Convert lint-circular-dependencies.sh to ↵laanwj
Python 79635c79e0533aa7f2e2440515ad766f965343ba lint: Convert lint-circular-dependencies.sh to Python (Smlep) Pull request description: Here is a port of `/test/lint/lint-circular-dependencies.sh` to a Python-script as part of the request of https://github.com/bitcoin/bitcoin/issues/24783. It aims to provide the same output as the bash version. ACKs for top commit: laanwj: Tested ACK 79635c79e0533aa7f2e2440515ad766f965343ba Tree-SHA512: f18077018f1229dd933cfe2bf0cfe7dc7d6538961c96a83c7a1f05e0cec4b068ca05502d68410d2aa4b6864523424db386e38233735190525904c2a8e9d2ba13
2022-04-25Merge bitcoin/bitcoin#24815: lint: convert lint-tests.sh to pythonlaanwj
ae0e06a439e09a7e24dd6198591a588c8df2d529 Converted lint-tests.sh to python (TakeshiMusgrave) Pull request description: Reference issue: https://github.com/bitcoin/bitcoin/issues/24783 ACKs for top commit: laanwj: Tested ACK ae0e06a439e09a7e24dd6198591a588c8df2d529 Tree-SHA512: a118295b5b6b5199b52d46b54de871d88dd544112e7dd5001a9575d65b093af0aea390f9ad223462a4fc6a201bd8c4debe5e26bfa4860a90c97cfe300477c04a
2022-04-25Merge bitcoin/bitcoin#24802: lint: convert format strings linter test to pythonlaanwj
267684ee34d795e4f762c4949fa45d99fe74dde3 lint: convert format strings linter test to python (Eunoia) Pull request description: Refs #24783 Attempted to keep the style and flow of implementation as it is. ### Additional Notes(Optional): 1. There is scope of improvement on how the related files are fetched. In this `git grep` with `subprocess` is still used as I found it to be the simplest. Any pointers on this are appreciated. 2. Removed sort operation on the matching files as I couldn't think of any strong arguments to have it. Any pointers on this are appreciated. 3. Not important, but one small detail is that the previous implementation was storing matched files for all the `function_names` iterated so far. Fixed that in this PR. ACKs for top commit: laanwj: Code review ACK 267684ee34d795e4f762c4949fa45d99fe74dde3 Tree-SHA512: 54ceae0c3501e561fdd9c5167b2dd8dd06da1b3697a077a042210970ce7004bda8c4e19abb1905ee64cbdce635f0a078508da645846ae7e81c016091f3f02458
2022-04-25Merge bitcoin/bitcoin#24929: lint: convert shell locale linter test to Pythonlaanwj
2c838cc309b2e3e1e30344178c17f789381a8b6b lint: convert shell locale linter test to Python (Eunoia) Pull request description: Refs #24783 ACKs for top commit: laanwj: Code review ACK 2c838cc309b2e3e1e30344178c17f789381a8b6b Tree-SHA512: 3cb5e7c7cd2acbdf0dc45096055b33cbfa0ec9e47ea567452d23a49a7441b3b62a8416879f234459c86fa892c42205c91d8a575115346c023ab0152cf713e20c
2022-04-25Merge bitcoin/bitcoin#24902: lint: Convert lint-include-guards.sh to Pythonlaanwj
d5fdec5cf8cffe8ece5460cd8c6e83ea6eebf625 Convert lint-include-guards.sh to python (brydinh) Pull request description: This PR addresses [issue 24783](https://github.com/bitcoin/bitcoin/issues/24783). Converted lint-include-guards.sh to python. ACKs for top commit: KevinMusgrave: Tested ACK d5fdec5cf8cffe8ece5460cd8c6e83ea6eebf625 laanwj: Code review ACK d5fdec5cf8cffe8ece5460cd8c6e83ea6eebf625 Tree-SHA512: cae566fc1b222b447c0d60ea20fd012f1cfde4dd07c1762ede2b2c9f84ed59ee8e629db1264dab8ac20bcac410e4c389827addf0a59757f94b40a65ea9bab466
2022-04-25Merge bitcoin/bitcoin#24916: lint: Convert lint-python-utf8-encoding.sh to ↵laanwj
Python 035eef4be6071a060260907001363a0d12f1f2d2 lint: Convert lint-python-utf8-encoding.sh to Python (Dimitri) Pull request description: A port of `test/lint/lint-python-utf8-encoding.sh` to a Python-script as part of the request of #24783. Checked for output-consistency. ACKs for top commit: laanwj: Code review ACK 035eef4be6071a060260907001363a0d12f1f2d2 Tree-SHA512: a8a2f505bf7953d318837182101346c44e73cfd1bf3b5342ff1400fb1c67c5292519fa99db1035da87cf27fb5f5ac5d28871bf55a1c085b5f8a3bb33ff0fa3fb
2022-04-25Merge bitcoin/bitcoin#24932: lint: Convert lint-locale-dependence.sh to Pythonlaanwj
3043a1bc9d32b451020b511c8340c12e0d99f8cc lint: Make known violations more specific in lint-locale-dependence (Dimitri) 229917d3d4798bf60ee2935f31529668bbb53a23 lint: Convert lint-locale-dependence.sh to Python (Dimitri) Pull request description: A port of `test/lint/lint-locale-dependence.sh` to a Python-script as part of the request of #24783. Checked for output-consistency. ACKs for top commit: laanwj: Tested and code review ACK 3043a1bc9d32b451020b511c8340c12e0d99f8cc Tree-SHA512: 80555cf7aac156bab5488f85098731d1c12a42667fe7d0df0c35487ab8fc951654a70a15351a759282eabab8319f5aabd8bdb153412b9edc3a9033bef64fd609
2022-04-25Merge bitcoin/bitcoin#24454: tests: Fix calculation of external input weightsfanquake
9f5ab670e7c8165f161ec44dbd95778c5515ece0 tests: Use descriptor that requires both legacy and segwit (Andrew Chow) 8a04a386f75d099f4b9864b0cdf7f26442b5801f tests: Calculate input weight more accurately (Andrew Chow) Pull request description: The external input tests with specifying input weight would sometimes result in a test failure because it would add 2 to the calculated byte size in order to account for some of the variation in signature and script sizes. However 1 in 128 signatures are actually 1 byte smaller than we expect, so the difference between the actual signature size and our calculated size becomes 3 bytes which is outside of the tolerance of `assert_fee_amount` and would thus cause the test failure. To resolve this, the 2 byte buffer is reduced to 1 byte, so in the above scenario, the difference is 2 bytes which is within the tolerance of `assert_fee_amount`. Additionally, instead of putting a fixed size that we assume is the correct size for the length of the compact size length prefix of data, we actually get the length of the compact size uint. Lastly, the size calculation for a scriptWitness was simply incorrect and used fields that did not exist. This is fixed, and the test slightly modified so that it also produces a scriptWitness. Fixes #24151 ACKs for top commit: jonatack: re-ACK 9f5ab670e7c8165f161ec44dbd95778c5515ece0 glozow: code review ACK 9f5ab670e7c8165f161ec44dbd95778c5515ece0 Tree-SHA512: b7c7ffe8fb0c07bc9e72fbff1f9ef57ee01a57c56bf54b8873345c8b9572c3ce9402b24dc211910b478114a9e6420faef5a4bf8866f38c299971354e54ec4745
2022-04-24init: disallow reindex-chainstate with optional indexesMartin Zumsande
It currently leads to corruption (coinstatsindex) or data duplication (blockfilterindex), so disable it.
2022-04-24Merge bitcoin/bitcoin#24812: util/check: Add CHECK_NONFATAL identity ↵MarcoFalke
function and NONFATAL_UNREACHABLE macro ee02c8bd9aedad8cfd3c2618035fe275da025fb9 util/check: Add CHECK_NONFATAL identity function, NONFATAL_UNREACHABLE AND UNREACHABLE macros (Aurèle Oulès) Pull request description: This PR replaces the macro `CHECK_NONFATAL` with an identity function. I simplified the usage of `CHECK_NONFATAL` where applicable in `src/rpc`. This function is useful in sanity checks for RPC and command-line interfaces. Context: https://github.com/bitcoin/bitcoin/pull/24804#discussion_r846182474. Also adds `UNREACHABLE_NONFATAL` macro. ACKs for top commit: jonatack: ACK ee02c8bd9aedad8cfd3c2618035fe275da025fb9 MarcoFalke: ACK ee02c8bd9aedad8cfd3c2618035fe275da025fb9 🍨 Tree-SHA512: 3cba09223cd7b22e62fe5d0b46c4a024c1d9957d4268ba6d3fb07fcc0a5854fc0886bb3266184e6a7df5df91373b3e84edd6adf6999c4e934aeef8c043b01aa2
2022-04-22Porting lint-assertions.sh to lint-assertions.pyhiago
2022-04-21tests: Use descriptor that requires both legacy and segwitAndrew Chow
2022-04-21lint: Convert lint-python-utf8-encoding.sh to PythonDimitri
2022-04-21lint: Make known violations more specific in lint-locale-dependenceDimitri
2022-04-21lint: Convert lint-locale-dependence.sh to PythonDimitri
2022-04-21Merge bitcoin/bitcoin#24936: test: compare `/mempool/contents` response with ↵MarcoFalke
`getrawmempool` RPC bef61496ab5e12e38ac5794cd0836723af070ab5 test: compare `/mempool/contents` response with `getrawmempool` RPC (brunoerg) 5bc5cbaf310f60e89c72e8ecf3f6187c85499027 doc: add reference to `getrawmempool` RPC in `/mempool/contents` REST doc (brunoerg) Pull request description: This PR is similar to #24797, it compares `/mempool/contents` REST response with `getrawmempool` RPC (verbose=True) since they use the same `MempoolToJSON` function. Also, adds a reference to `getrawmempool` RPC help to get details about the fields from `/mempool/contents`. ACKs for top commit: 0xB10C: ACK bef6149 Tree-SHA512: b7e9e9c765ee837986ba167b9234a9b95c9ef0a9ebcc2a03d50f6be6d3aba1480bd77c78111d95df1e4023cde6dfc64bf1e7908d9e5b6f96ca46b76611a4a9b4
2022-04-21test: Add test for coinselection tracepointsAndrew Chow
2022-04-21Merge bitcoin/bitcoin#24803: lint: convert submodule linter test to Pythonlaanwj
4a9e36dbaf96f83d0829f8442114a2fa36641776 lint: convert submodule linter test to Python (Eunoia) Pull request description: Refs #24783 ACKs for top commit: laanwj: Tested ACK 4a9e36dbaf96f83d0829f8442114a2fa36641776 Tree-SHA512: ca25b59acf75cebc79588a6c51dc5c313c8d0bd1d492127815d7b81b36aaffd02815a515d97b355582002f71efc33d46435d0b28fce24497bb99799d9ba57228
2022-04-21Merge bitcoin/bitcoin#24918: test: Remove unused taproot node from ↵MarcoFalke
wallet_taproot.py fa2153b05b12d29fd2be88d6cadefa075a36291c test: Remove unused taproot node from wallet_taproot.py (MarcoFalke) Pull request description: Now that the wallet considers taproot always active after commit 064c729a96, there is no need to test for it. ACKs for top commit: dunxen: Code review ACK fa2153b brunoerg: crACK fa2153b05b12d29fd2be88d6cadefa075a36291c Tree-SHA512: 24e4a66e43d1391acb63fd0c0c52677b0eef7f618b87a5b1a75224a9be58c9c3f8bba2de3b7510f25a686865b027f7f535e653d40d519d0e00ace38f0c7aba0c
2022-04-21test: compare `/mempool/contents` response with `getrawmempool` RPCbrunoerg
2022-04-20lint: Convert lint-circular-dependencies.sh to PythonSmlep
2022-04-20lint: convert shell locale linter test to PythonEunoia
2022-04-20Convert lint-include-guards.sh to pythonbrydinh
Specify encoding when reading header files, add docstring Update test/lint/lint-include-guards.py include guard count logic Co-authored-by: Kevin Musgrave <tkm45@cornell.edu> Update test/lint/lint-include-guards.py by removing whitespace
2022-04-20Merge bitcoin/bitcoin#24895: lint: Convert lint-includes.sh to PythonMarcoFalke
67b41678c8284715c9cf96d6bdbde9a072b7a904 lint: Convert lint-includes.sh to Python (Dimitri) Pull request description: A port of `test/lint/lint-includes.sh` to a Python-script as part of the request of #24783. Checked for output-consistency. ACKs for top commit: KevinMusgrave: Tested ACK 67b41678c8284715c9cf96d6bdbde9a072b7a904 Tree-SHA512: 05b4b114dc101e571004aee8aea1480e4dda1dc645426100649e9cb81e56e8667f88d6d5646a9860ea1c7abc36754eda2a77ec10156c54b62db00e2c00b8ceae
2022-04-20lint: convert submodule linter test to PythonEunoia
2022-04-19Merge bitcoin/bitcoin#24896: test: use MiniWallet for p2p_segwit.pyMarcoFalke
917a89a814f15e69174d8b26c1ef75e01555ecb3 test: use MiniWallet for p2p_segwit.py (Sebastian Falbesoner) Pull request description: This PR enables one more of the non-wallet functional tests (p2p_segwit.py) to be run even with the Bitcoin Code wallet by using the MiniWallet instead, as proposed in https://github.com/bitcoin/bitcoin/issues/20078. This change only affects the subtest `test_superfluous_witness`. Note that instead of creating a raw transaction first and then signing it, we go the other direction here: MiniWallet creates a transaction spending a segwit v1 output (i.e. including a witness), then we turn it into a raw transaction by dropping the witness. Therefore, the debug log asserts are swapped. Top commit has no ACKs. Tree-SHA512: 163a93a527f60100487f0aff49a9d7baf392ceb4417c54521157b2678685f5728dd751a9747c6cf51666aae78252dd3bc44130e659f7a1262ec1c86e30225622
2022-04-19doc: Fix a link to `test/lint/lint-python.py`Hennadii Stepanov
2022-04-19test: Remove unused taproot node from wallet_taproot.pyMarcoFalke
2022-04-19lint: Convert lint-includes.sh to PythonDimitri
2022-04-18Merge bitcoin/bitcoin#24794: lint: Convert Python linter to Pythonlaanwj
47b66ac4acd148da9fd0d894574f8bb3b3b33368 lint: Convert Python linter to Python (Fabian Jahr) Pull request description: The outputs provided by the Python version should be exactly the same as the ones from the shell version. There is small improvement here: Previously only the dependency of `flake9` was checked, now all dependencies are checked before running. I also tried to mostly follow the [recommendations here](https://github.com/bitcoin/bitcoin/pull/24766#pullrequestreview-932953476) but happy to make more changes if there is still room for improvement. ACKs for top commit: laanwj: Tested ACK 47b66ac4acd148da9fd0d894574f8bb3b3b33368 Tree-SHA512: 1630188e176c1063b8905669b76682b361a858cde6990ab17e51ad4333bf376eab796050cdb9f2967b84f1f74379d9e860c4258561b1964e1a47183c593e5bb4
2022-04-18Merge bitcoin/bitcoin#24853: lint: Convert lint-git-commit-check.sh to Pythonlaanwj
f27fcd9bf4d667f78055d4b3ee6f426e4c5ffe16 lint: Convert lint-git-commit-check.sh to Python (Dimitri) Pull request description: A port of `/test/lint/lint-git-commit-check.sh` to a Python-script as part of the request of #24783 . Checked for output-consistency. ACKs for top commit: laanwj: re-ACK f27fcd9bf4d667f78055d4b3ee6f426e4c5ffe16 Tree-SHA512: afc4a662f4aec1796c023b98a875c1591940ecdfc709eefe2df29d33e51e807c3c2e2b5c410aa3ad1cd3f6f8207f5c15b638637ff9f5659cafa7543bbe8a0bae
2022-04-18Merge bitcoin/bitcoin#24844: lint: Convert lint-whitespace.sh to Pythonlaanwj
a75f6d86d1bd21a79cbbe141274f04aa4365985e lint: Convert lint-whitespace.sh to Python (Dimitri) Pull request description: A port of `/test/lint/lint-whitespace.sh` to a Python-script as part of the request of #24783 . Checked for output-consistency. ACKs for top commit: laanwj: Code review and tested ACK a75f6d86d1bd21a79cbbe141274f04aa4365985e Tree-SHA512: 982041b0beb1b3866493ad523950c9a536a8b1ec79b773fe86dbc1166844c13a30b384e92025f845d45d25334f90f3abda5fa23f0f28e7c2cddc5e496f84c445
2022-04-18Merge bitcoin/bitcoin#24859: wallet: Change wallet validation orderAndrew Chow
6f29409ad180ef00998ac05997f0fa03f98cd066 test: Add a test that creates a wallet with invalid parameters (w0xlt) 0359d9b6a3808e70af6e19b85d13371eb0434ce5 Change wallet validation order (w0xlt) Pull request description: In the current code, the database is created before the last validation, which checks that passphrase is set and private keys are disabled. Therefore, if this validation fails, it will result in an empty database and the user will not be able to recreate a wallet with the same name and with the correct parameters. Behavior on the master branch: ``` $ ./src/bitcoin-cli -regtest -named createwallet wallet_name="invalid_wallet_01" disable_private_keys=true passphrase="passphrase" error code: -4 error message: Passphrase provided but private keys are disabled. A passphrase is only used to encrypt private keys, so cannot be used for wallets with private keys disabled. $ ./src/bitcoin-cli -regtest -named createwallet wallet_name="invalid_wallet_01" error code: -4 error message: Wallet file verification failed. Failed to create database path '/home/w/.bitcoin/regtest/wallets/invalid_wallet'. Database already exists. ``` Behavior on the PR branch: ``` $ ./src/bitcoin-cli -regtest -named createwallet wallet_name="invalid_wallet_02" disable_private_keys=true passphrase="passphrase" error code: -4 error message: Passphrase provided but private keys are disabled. A passphrase is only used to encrypt private keys, so cannot be used for wallets with private keys disabled. $ ./src/bitcoin-cli -regtest -named createwallet wallet_name="invalid_wallet_02" { "name": "invalid_wallet_01", "warning": "" } ``` ACKs for top commit: achow101: ACK 6f29409ad180ef00998ac05997f0fa03f98cd066 Tree-SHA512: d192955fc2285bf27ae5dd4c1b7cfd3d85441a7f3554b189b974aefb319c6b997543991dbb0ca2c8cb980f7058913a77cf0164c02e9b51ceb9c2cb601317c428
2022-04-18lint: Convert Python linter to PythonFabian Jahr
2022-04-17test: use MiniWallet for p2p_segwit.pySebastian Falbesoner
This change only affects the subtest `test_superfluous_witness`. Note that instead of creating a raw transaction first and then signing it, we go the other direction here: MiniWallet creates a transaction spending a segwit v1 output (i.e. including a witness), then we turn it into a raw transaction by dropping the witness. Therefore, the debug log asserts are swapped.
2022-04-16lint: Convert lint-whitespace.sh to PythonDimitri
2022-04-16lint: Convert lint-git-commit-check.sh to PythonDimitri
2022-04-16util/check: Add CHECK_NONFATAL identity function, NONFATAL_UNREACHABLE AND ↵Aurèle Oulès
UNREACHABLE macros
2022-04-16Merge bitcoin/bitcoin#24855: rpc: Fix `setwalletflag` disabling of flagsfanquake
88376c623cff3602d04ec6c94a89552aefa20fa7 test: Test for disabling wallet flags (Andrew Chow) 17ab31aa46f7b5c265d07091fe45671ef2af6a9a rpc, wallet: setwalletflags warnings are optional (Andrew Chow) Pull request description: Trying to disable a wallet flag with `setwalletflag` results in `Internal bug detected: 'std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [ret](const RPCResult& res) { return res.MatchesType(ret); })'`. This occurs because the `warnings` field was not marked as optional. This PR makes `warnings` optional to avoid this error. Also added a test case because apparently we didn't already have one. ACKs for top commit: w0xlt: ACK 88376c6 Tree-SHA512: 4f5d3bebf0d022a5ad0f75d70c6562a43c7da6e39e9c3118733327d015c435e2c8d5004fdb039d42407dde5b21231a0f8827623d718abf611a1f06c15af5c806
2022-04-16test: Add a test that creates a wallet with invalid parametersw0xlt
Invalid parameters must not prevent a new wallet with the same name from being created with the correct parameters
2022-04-15Converted lint-tests.sh to pythonTakeshiMusgrave
Use raw string Use re.search instead of grep in check_matching_test_names Replaced bash commands in check_unique_test_names with python commands Use set and sort output Use set comprehension Use .splitlines() Call grep_boost_fixture_test_suite once splitlines() once Fixed copyright date Use check_output() instead of run() add encoding='utf8' Use clearer code for getting duplicates