Skip to content

Commit

Permalink
test: check scanning field from getwalletinfo
Browse files Browse the repository at this point in the history
During a rescan, check that `getwalletinfo` returns
properly information (the scanning field) about it.
  • Loading branch information
brunoerg committed Feb 4, 2025
1 parent 809d7e7 commit bb0879d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/functional/wallet_importdescriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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 (
Expand Down Expand Up @@ -705,6 +706,13 @@ def run_test(self):
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())
Expand Down

0 comments on commit bb0879d

Please sign in to comment.