aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_multiwallet.py
AgeCommit message (Collapse)Author
2020-05-01wallet: Remove trailing whitespace from potential translation stringsMarcoFalke
If the potential translation strings are translated in the future, trailing whitespace is going to make translation effort harder.
2020-04-19Merge #15761: Replace -upgradewallet startup option with upgradewallet RPCMarcoFalke
0d32d661481f099af572e7a08a50e17bcc165c44 Remove -upgradewallet startup option (Andrew Chow) 92263cce5b6c6b66296dadda5f29724611db0160 Add upgradewallet RPC (Andrew Chow) 1e48796c99b63aa8fa8451ce7b0c20759ea43500 Make UpgradeWallet a member function of CWallet (Andrew Chow) c988f27937bc79c90f4eed48552c72f1b66dc044 Have UpgradeWallet take the version to upgrade to and an error message out parameter (Andrew Chow) 183323712398e26ddcf3a9dc048aaa9900a91f5a Only run UpgradeWallet if the wallet needs to be upgraded (Andrew Chow) 9c16b1735f8e530ce68d678e9ca0eceb2ceb3520 Move wallet upgrading to its own function (Andrew Chow) Pull request description: `-upgradewallet` is largely incompatible with many recent wallet features and versions. For example, it was disabled if multiple wallets were used and would not work with encrypted wallets that were being upgraded to HD. This PR does away with the old method of upgrading upon startup and instead allows users to upgrade their wallets via an `upgradewallet` RPC. This does largely the same thing as the old `-upgradewallet` option but because the wallet is loaded, it can be unlocked to upgrade to HD. Furthermore it is compatible with multiwallet as it works on the individual wallet that is specified by the RPC. ACKs for top commit: meshcollider: Code review ACK 0d32d661481f099af572e7a08a50e17bcc165c44 darosior: ACK 0d32d661481f099af572e7a08a50e17bcc165c44 MarcoFalke: ACK 0d32d661481f099af572e7a08a50e17bcc165c44 šŸšµ Tree-SHA512: b425bf6f5d605e26506889d63c780895482f07cbc086193218e031e8504d3072d41e90d65cd41bcc98ee4c1eb048954bc5d4ac85435f7394892373aac89a3b0a
2020-04-17Merge #18673: scripted-diff: Sort test includesMarcoFalke
fa4632c41714dfaa699bacc6a947d72668a4deef test: Move boost/stdlib includes last (MarcoFalke) fa488f131fd4f5bab0d01376c5a5013306f1abcd scripted-diff: Bump copyright headers (MarcoFalke) fac5c373006a9e4bcbb56843bb85f1aca4d87599 scripted-diff: Sort test includes (MarcoFalke) Pull request description: When writing tests, often includes need to be added or removed. Currently the list of includes is not sorted, so developers that write tests and have `clang-format` installed will either have an unrelated change (sorting) included in their commit or they will have to manually undo the sort. This pull preempts both issues by just sorting all includes in one commit. Please be aware that this is **NOT** a change to policy to enforce clang-format or any other developer guideline or process. Developers are free to use whatever tool they want, see also #18651. Edit: Also includes a commit to bump the copyright headers, so that the touched files don't need to be touched again for that. ACKs for top commit: practicalswift: ACK fa4632c41714dfaa699bacc6a947d72668a4deef jonatack: ACK fa4632c41714dfaa, light review and sanity checks with gcc build and clang fuzz build Tree-SHA512: 130a8d073a379ba556b1e64104d37c46b671425c0aef0ed725fd60156a95e8dc83fb6f0b5330b2f8152cf5daaf3983b4aca5e75812598f2626c39fd12b88b180
2020-04-17Merge #18467: rpc: Improve documentation and return value of settxfeeMarcoFalke
38677274f931088218eeb1f258077d3387f39c89 rpc: settxfee respects -maxtxfee wallet setting (Fabian Jahr) bda84a08a0ac92dff6cadc99cf9bb8c3fadd7e13 rpc: Add documentation for deactivating settxfee (Fabian Jahr) Pull request description: ~~Closes 18315~~ `settxfee` can be deactivated by passing 0 as the fee. That does not seem to be documented for the user so this PR adds it in the description. The return value of a simple boolean seems also too simplified given the multiple dimensions that this deactivation feature enables. I.e. it does not seem intuitive if the returned boolean shows that the call succeeded or if means that `settxfee` is active. My suggested solution is to change the return value to a JSON object that included the "active" state and the currently set fee rate. Examples: ``` $ src/bitcoin-cli settxfee 0.0000000 { "active": false, "fee_rate": "0.00000000 BTC/kB" } $ src/bitcoin-cli settxfee 0.0001 { "active": true, "fee_rate": "0.00010000 BTC/kB" } ``` ACKs for top commit: MarcoFalke: ACK 38677274f931088218eeb1f258077d3387f39c89, seems useful to error out early instead of later #16257 šŸ• jonatack: ACK 38677274f931088218eeb meshcollider: LGTM, utACK 38677274f931088218eeb1f258077d3387f39c89 Tree-SHA512: 642813b5cf6612abb4b6cb63728081a6bd1659d809e0149c8f56060b6da7253fee989b3b202854f3051df3773c966799af30b612648c466b099f00590f356548
2020-04-16scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-04-14rpc: settxfee respects -maxtxfee wallet settingFabian Jahr
2020-04-13Remove -upgradewallet startup optionAndrew Chow
2020-03-31wallet: Handle duplicate fileid exceptionJoĆ£o Barbosa
2020-03-14test: Bump timeouts to avoid valgrind failuresMarcoFalke
2020-02-04Merge #16681: Tests: Use self.chain instead of 'regtest' in all current testsMarcoFalke
1abcecc40c518a98b7d17880657ec0247abdf125 Tests: Use self.chain instead of 'regtest' in almost all current tests (Jorge TimĆ³n) Pull request description: Simply avoiding the hardcoded string in more places for consistency. It can also allow for more easily reusing tests for other chains other than regtest. Separated from #8994 . Continues #16509 . It is still not complete (ie to be complete, we need the -chain parameter in #16680 and make whether acceptnonstdtxs is allowed for that chain or not customizable for regtest [or for custom chains like in #8994 ] ). But while being incomplete like #16509 , it's quite simple to review and another step forward IMO. ACKs for top commit: Sjors: re-ACK 1abcecc. I think it's an improvement even if incomplete and if some PR's might accidentally bring "regtest" back. Subsequent improvements hopefully don't have to touch 16 files. elichai: Code review ACK 1abcecc40c518a98b7d17880657ec0247abdf125 ryanofsky: Code review ACK 1abcecc40c518a98b7d17880657ec0247abdf125. ryanofsky: Code review ACK 1abcecc40c518a98b7d17880657ec0247abdf125 Tree-SHA512: 5620de6dab235ca8bd8670d6366c7b9f04f0e3ca9c5e7f87765b38e16ed80c17d7d1630c0d5fd7c5526f070830d94dc74cc2096d8ede87dc7180ed20569509ee
2019-12-06tests: Use a default of supports_cli=True (instead of supports_cli=False)practicalswift
2019-10-26Tests: Use self.chain instead of 'regtest' in almost all current testsJorge TimĆ³n
2019-10-08wallet: Avoid showing GUI popups on RPC errorsMarcoFalke
2019-09-09Merge #16796: wallet: Fix segfault in CreateWalletFromFileSamuel Dobson
fa734603b78ba31ebf0da5d2dbe87386eafff01a wallet: Fix segmentation fault in CreateWalletFromFile (MarcoFalke) fab3c34412379598b812631e3c123e9467cdc485 test: Print both messages on failure in assert_raises_message (MarcoFalke) faa13539d5262bb7a512e9ff82e80083e04315ee wallet: Fix documentation around WalletParameterInteraction (MarcoFalke) Pull request description: Comes with a test to aid review. The test should fail without the fix to bitcoind The following `CreateWalletFromFile` issues are fixed: * `walletFile` refers to freed memory and will thus corrupt the debug.log and/or crash the node if read * `WalletParameterInteraction` was moved to `CreateWalletFromFile` and `WalletInit::ParameterInteraction` without updating the documentation ACKs for top commit: promag: ACK fa734603b78ba31ebf0da5d2dbe87386eafff01a. darosior: ACK fa734603b78ba31ebf0da5d2dbe87386eafff01a meshcollider: LGTM, code-read ACK fa734603b78ba31ebf0da5d2dbe87386eafff01a Tree-SHA512: 2aceb63a3f25b90a840cfa08d37f5874aad4eb3df8c2ebf94e2ed18b55809b185e6920bdb345b988bff1fcea5e68a214fe06c361f7da2c01a3cc29e0cc421cb4
2019-09-03test/contrib: Fix invalid escapes in regex stringsBen Woosley
Flagged by flake8 v3.6.0, as W605, plus a few others identified incidentally, e.g. 59ffecf66cf4d08c4b431e457b083878d66a3fd6. Note that r"\n" matches to "\n" under re.match/search.
2019-09-03wallet: Fix segmentation fault in CreateWalletFromFileMarcoFalke
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-02-04qa: Test .walletlock file is closedJoĆ£o Barbosa
2018-11-06wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a ā†µChun Kuan Lee
directory.
2018-10-25Remove fs::relative call and fix listwalletdir testsJoĆ£o Barbosa
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-24appveyor: Enable multiwallet testChun Kuan Lee
2018-10-24Merge #14320: [bugfix] wallet: Fix duplicate fileid detectionWladimir J. van der Laan
4ea77320c5f0b275876be41ff530bb328ba0cb87 tests: add test case for loading copied wallet twice (Chun Kuan Lee) 2d796faf62095e83f74337c26e7e1a8c3957cf3c 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-24tests: add test case for loading copied wallet twiceChun Kuan Lee
2018-10-24Merge #14453: rpc: Fix wallet unload during walletpassphrase timeoutWladimir J. van der Laan
8907df9e02ec47ef249a7422faa766f06aa01e94 qa: Ensure wallet unload during walletpassphrase timeout (JoĆ£o Barbosa) 321decffa1fbf213462d97e5372bd0c4eeb99635 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-23Merge #14468: [wallet] Deprecate generate RPC methodMarcoFalke
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-20qa: Ensure wallet unload during walletpassphrase timeoutJoĆ£o Barbosa
2018-10-19Merge #14291: wallet: Add ListWalletDir utility functionWladimir J. van der Laan
d56a0689354fb814510c6c393f3e07ac9362dc1f docs: Add release notes for listwalletdir RPC (JoĆ£o Barbosa) 0cb3cad166bbeb75e9cc1512286453f8e7d4f717 qa: Add tests for listwalletdir RPC (JoĆ£o Barbosa) cc3377360c417780f5cbd7bd69b438817a9d60be rpc: Add listwalletdir RPC (JoĆ£o Barbosa) d1b03b8e5f04a2cc9ebb985bd9a1aebd2068f757 interfaces: Add getWalletDir and listWalletDir to Node (JoĆ£o Barbosa) fc4db35bfd78d85d6b52d5da3d89696160658450 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-18qa: Add tests for listwalletdir RPCJoĆ£o Barbosa
2018-10-16[tests] Small fixups before deprecating generateJohn Newbery
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-09-17tests: Make it possible to run functional tests on WindowsChun Kuan Lee
2018-09-10qa: Run all tests even if wallet is not compiledMarcoFalke
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-15wallet: Fix backupwallet for multiwalletsDaniel Kraft
backupwallet was broken for multiwallets in their own directories (i.e. something like DATADIR/wallets/mywallet/wallet.dat). In this case, the backup would use DATADIR/wallets/wallet.dat as source file and not take the specific wallet's directory into account. This led to either an error during the backup (if the wrong source file was not present) or would silently back up the wrong wallet; especially the latter behaviour can be quite bad for users.
2018-06-28[wallet] loadwallet shouldn't create new wallets.John Newbery
A bug in the initial implementation of loadwallet meant that if the arguement was a directory that didn't contain a wallet.dat file, a new wallet would be created in that directory. Fix that so that if a directory is passed in, it must contain a wallet.dat file. Bug reported by promag (JoĆ£o Barbosa).
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-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-12Explicitly specify encoding when opening text files in Python codepracticalswift
2018-05-31[wallet] [tests] Add tests for `createwallet` RPC.John Newbery
2018-05-16[wallet] [tests] Test loadwalletJohn Newbery
Add testcases to wallet_multiwallet.py to test the new `loadwallet` RPC method.
2018-04-24Merge #12909: wallet: Make fee settings to be non-static membersWladimir J. van der Laan
fac0db0 wallet: Make fee settings non-static members (MarcoFalke) Pull request description: The wallet header defined some globals (they were called "settings"), that should be class members instead. This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case) Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
2018-04-23wallet: Make fee settings non-static membersMarcoFalke
2018-04-19[wallet] [tests] Test disallowed multiwallet paramsJohn Newbery
Add a test to check that bitcoind fails to start when specifying -zapwallettxes, -salvagewallet and -upgradewallet when running in multiwallet mode.
2018-04-07scripted-diff: Rename wallet database classesRussell Yanofsky
-BEGIN VERIFY SCRIPT- sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; } ren CDBEnv BerkeleyEnvironment ren CDB BerkeleyBatch ren CWalletDBWrapper WalletDatabase ren CWalletDB WalletBatch ren dbw database ren m_dbw m_database ren walletdb batch ren pwalletdb batch ren pwalletdbIn batch_in ren wallet/batch.h wallet/walletdb.h ren pwalletdbEncryption encrypted_batch -END VERIFY SCRIPT-
2018-04-01qa: Match full plain text by defaultMarcoFalke
2018-03-22Merge #12076: qa: Use node.datadir instead of tmpdir in test frameworkWladimir J. van der Laan
c8330d4 qa: Use node.datadir instead of tmpdir in test framework (MarcoFalke) Pull request description: Commit c53c9831eedaf3b311bb942945268830f9ba3abc introduced the utility function `get_datadir_path`, however not all places in the code use this util function. Using the util function everywhere makes it easier to review pull requests related to the datadir. This commit replaces datadir path creation with the `datadir` member of `TestNode`, which itself uses `get_datadir_path`. Tree-SHA512: c75707ab7149d732a6d56152a5813138a33459d3d07577b60b89f2a207c83b7663fac5f203593677c9892d1c23a5eba4bd45c5c4ababf040d720b437240fcddf
2018-03-19qa: Allow for partial_match when checking init errorMarcoFalke
This allows the tests to pass on different platforms
2018-03-19qa: Use node.datadir instead of tmpdir in test frameworkMarcoFalke