From bb0879ddabc8b3a7253bc774d23b842937d18015 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Thu, 30 Jan 2025 15:57:10 -0300 Subject: [PATCH] test: check `scanning` field from `getwalletinfo` During a rescan, check that `getwalletinfo` returns properly information (the scanning field) about it. --- test/functional/wallet_importdescriptors.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/wallet_importdescriptors.py b/test/functional/wallet_importdescriptors.py index 84c07b6a282..03e26465f1c 100755 --- a/test/functional/wallet_importdescriptors.py +++ b/test/functional/wallet_importdescriptors.py @@ -24,6 +24,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.descriptors import descsum_create from test_framework.util import ( assert_equal, + assert_greater_than, assert_raises_rpc_error, ) from test_framework.wallet_util import ( @@ -705,6 +706,13 @@ class ImportDescriptorsTest(BitcoinTestFramework): except JSONRPCException as e: 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"] + wallet_info = self.nodes[0].cli("-rpcwallet=encrypted_wallet").getwalletinfo() + try: + duration = wallet_info["scanning"]["duration"] + assert_greater_than(duration, 0) + except Exception: + assert "scanning" not in wallet_info + assert_equal(importing.result(), [{"success": True}]) assert_equal(temp_wallet.getbalance(), encrypted_wallet.getbalance())