-
Notifications
You must be signed in to change notification settings - Fork 38.7k
cli: Improve error message on multiwallet cli-side commands #26990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,12 @@ | |||||
| BLOCKS_VALUE_OF_ZERO = 'error: the first argument (number of blocks to generate, default: 1) must be an integer value greater than zero' | ||||||
| TOO_MANY_ARGS = 'error: too many arguments (maximum 2 for nblocks and maxtries)' | ||||||
| WALLET_NOT_LOADED = 'Requested wallet does not exist or is not loaded' | ||||||
| WALLET_NOT_SPECIFIED = 'Wallet file not specified' | ||||||
| WALLET_NOT_SPECIFIED = ( | ||||||
| "Multiple wallets are loaded. Please select which wallet to use by requesting the RPC " | ||||||
| "through the /wallet/<walletname> URI path. Or for the CLI, specify the \"-rpcwallet=<walletname>\" " | ||||||
| "option before the command (run \"bitcoin-cli -h\" for help or \"bitcoin-cli listwallets\" to see " | ||||||
| "which wallets are currently loaded)." | ||||||
| ) | ||||||
|
|
||||||
|
|
||||||
| def cli_get_info_string_to_dict(cli_get_info_string): | ||||||
|
|
@@ -331,6 +336,10 @@ def run_test(self): | |||||
| n4 = 10 | ||||||
| blocks = self.nodes[0].getblockcount() | ||||||
|
|
||||||
| self.log.info('Test -generate -rpcwallet=<filename> raise RPC error') | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit if you retouch:
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do this on the follow-up where I'll be adding the validation from the 2nd commit that was dropped from this PR. |
||||||
| wallet2_path = f'-rpcwallet={self.nodes[0].wallets_path / wallets[2] / self.wallet_data_filename}' | ||||||
| assert_raises_rpc_error(-18, WALLET_NOT_LOADED, self.nodes[0].cli(wallet2_path, '-generate').echo) | ||||||
|
|
||||||
| self.log.info('Test -generate -rpcwallet with no args') | ||||||
| generate = self.nodes[0].cli(rpcwallet2, '-generate').send_cli() | ||||||
| assert_equal(set(generate.keys()), {'address', 'blocks'}) | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.