Skip to content

Commit 2549fc6

Browse files
committed
Merge bitcoin/bitcoin#31768: test: check scanning field from getwalletinfo
bb0879d test: check `scanning` field from `getwalletinfo` (brunoerg) Pull request description: During a rescan, check that `getwalletinfo` returns properly information (the scanning field) about it. ACKs for top commit: maflcko: lgtm ACK bb0879d arejula27: ACK [`bb0879d`](bitcoin/bitcoin@bb0879d) achow101: ACK bb0879d BrandonOdiwuor: Code Review ACK bb0879d Prabhat1308: re-ACK [`bb0879d`](bitcoin/bitcoin@bb0879d) Tree-SHA512: 9bca1c1e813bf4f61a5621bdc0a5f5c2bcfb388ffe9dfacb821bf6954f6e0880140d72258dc93ab6b84efb54f55c682a17aebd42f6559d6cfac9998e6bc4e5b9
2 parents 96d30ed + bb0879d commit 2549fc6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/functional/wallet_importdescriptors.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from test_framework.descriptors import descsum_create
2525
from test_framework.util import (
2626
assert_equal,
27+
assert_greater_than,
2728
assert_raises_rpc_error,
2829
)
2930
from test_framework.wallet_util import (
@@ -705,6 +706,13 @@ def run_test(self):
705706
except JSONRPCException as e:
706707
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"]
707708

709+
wallet_info = self.nodes[0].cli("-rpcwallet=encrypted_wallet").getwalletinfo()
710+
try:
711+
duration = wallet_info["scanning"]["duration"]
712+
assert_greater_than(duration, 0)
713+
except Exception:
714+
assert "scanning" not in wallet_info
715+
708716
assert_equal(importing.result(), [{"success": True}])
709717

710718
assert_equal(temp_wallet.getbalance(), encrypted_wallet.getbalance())

0 commit comments

Comments
 (0)