-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: Verify that a message is not in rpc errors raised (follow-up 31451) #32174
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
test: Verify that a message is not in rpc errors raised (follow-up 31451) #32174
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32174. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
2038974 to
eff1c0d
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
|
@pablomartin4btc Based on the commit, I see that an unwanted message variable was added to I was trying to verify the fix by triggering the error on the master branch (before this change), but I’m not sure how to reproduce it. Could you give me a quick heads-up on how to get the error to appear, so I can confirm that the changes properly prevent it? Sorry if this is a basic question— I want to make sure I’m testing it correctly. Appreciate the help! |
|
Thanks @enirox001 for reviewing this PR!
No problem. This was a bug that was already fixed in --- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4610,7 +4610,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(std::shared_ptr<CWallet>
// Reload it into memory if the wallet was previously loaded.
bilingual_str restore_error;
const auto& ptr_wallet = RestoreWallet(context, temp_backup_location, wallet_name, /*load_on_start=*/std::nullopt, status, restore_error, warnings, /*load_after_restore=*/was_loaded);
- if (!restore_error.empty()) {
+ if (restore_error.empty()) {
error += restore_error + _("\nUnable to restore backup of wallet.");
return util::Error{error};
} |
|
ACK. I tested this by modifying the line immediately following RestoreWallet, which triggered the hidden failure message and revealed the unwanted error. This fix successfully ensures that the unwanted message is no longer included in the RPC error outputs. |
Check that the message passed in **kwds, named unwanted_message, is not among the errors raised by the rpc call.
eff1c0d to
9a4a61f
Compare
|
This PR does not seem to have attracted much attention from reviewers. As such, it does not seem important enough right now to keep it sitting idle in the list of open PRs. Closing due to lack of interest. |
This follow-up was proposed in #31451 (comment).
Verify that an unwanted message is not among the errors raised by the rpc call, otherwise raise an exception with the details.