getwalletinfo
returns properly information (the scanning field) about it.
test: check scanning
field from getwalletinfo
#31768
pull
brunoerg
wants to merge
1
commits into
bitcoin:master
from
brunoerg:2025-01-test-wallet-scan
changing
1
files
+8 −0
-
brunoerg commented at 7:01 pm on January 30, 2025: contributorDuring a rescan, check that
-
DrahtBot commented at 7:01 pm on January 30, 2025: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31768.
Reviews
See the guideline for information on the review process.
Type Reviewers ACK maflcko, arejula27 Stale ACK Prabhat1308 If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
DrahtBot added the label Tests on Jan 30, 2025
-
brunoerg marked this as a draft on Jan 30, 2025
-
DrahtBot added the label CI failed on Jan 30, 2025
-
brunoerg force-pushed on Jan 30, 2025
-
brunoerg marked this as ready for review on Jan 30, 2025
-
DrahtBot removed the label CI failed on Jan 30, 2025
-
Prabhat1308 approved
-
Prabhat1308 commented at 11:39 pm on February 1, 2025: none
ACK e7f5955
confirms the duration of rescanning to be greater than 0
-
test: check `scanning` field from `getwalletinfo`
During a rescan, check that `getwalletinfo` returns properly information (the scanning field) about it.
-
in test/functional/wallet_importdescriptors.py:709 in e7f5955ee0 outdated
705@@ -705,6 +706,7 @@ def run_test(self): 706 except JSONRPCException as e: 707 assert e.error["code"] == -4 and "Error: the wallet is currently being used to rescan the blockchain for related transactions. Please call `abortrescan` before changing the passphrase." in e.error["message"] 708 709+ assert_greater_than(self.nodes[0].cli("-rpcwallet=encrypted_wallet").getwalletinfo()["scanning"]["duration"], 0)
maflcko commented at 9:09 am on February 4, 2025:Won’t this race withimporting
and intermittently fail?
brunoerg commented at 2:02 pm on February 4, 2025:You’re right, could happen. I just added a try/except around it, now it checks the duration is greater than 0 or if the field is not returned intogetwalletinfo
response.brunoerg force-pushed on Feb 4, 2025maflcko commented at 3:17 pm on February 4, 2025: memberlgtm ACK bb0879ddabc8b3a7253bc774d23b842937d18015DrahtBot requested review from Prabhat1308 on Feb 4, 2025arejula27 commented at 7:09 pm on February 5, 2025: noneACK
bb0879d
The test looks good as it improves the verification of an RPC call field. However, the verified field produces different values depending on the scan situation:
“scanning” : { (json object) current scanning details, or false if no scan is in progress> “duration” : n, (numeric) elapsed seconds since scan start “progress” : n (numeric) scanning progress percentage [0.0, 1.0] },
I believe this PR would be more complete if it also verified the
false
case—for example, when importing thep2pkh
descriptor for the first time (around line 108).
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-07 15:12 UTC
More mirrored repositories can be found on mirror.b10c.me