mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge bitcoin/bitcoin#31768: test: check scanning
field from getwalletinfo
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
bb0879ddab
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 ACKbb0879ddab
arejula27: ACK [`bb0879d`](bb0879ddab
) achow101: ACKbb0879ddab
BrandonOdiwuor: Code Review ACKbb0879ddab
Prabhat1308: re-ACK [`bb0879d`](bb0879ddab
) Tree-SHA512: 9bca1c1e813bf4f61a5621bdc0a5f5c2bcfb388ffe9dfacb821bf6954f6e0880140d72258dc93ab6b84efb54f55c682a17aebd42f6559d6cfac9998e6bc4e5b9
This commit is contained in:
commit
2549fc6fd1
1 changed files with 8 additions and 0 deletions
|
@ -24,6 +24,7 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.descriptors import descsum_create
|
from test_framework.descriptors import descsum_create
|
||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
assert_equal,
|
assert_equal,
|
||||||
|
assert_greater_than,
|
||||||
assert_raises_rpc_error,
|
assert_raises_rpc_error,
|
||||||
)
|
)
|
||||||
from test_framework.wallet_util import (
|
from test_framework.wallet_util import (
|
||||||
|
@ -705,6 +706,13 @@ class ImportDescriptorsTest(BitcoinTestFramework):
|
||||||
except JSONRPCException as e:
|
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"]
|
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(importing.result(), [{"success": True}])
|
||||||
|
|
||||||
assert_equal(temp_wallet.getbalance(), encrypted_wallet.getbalance())
|
assert_equal(temp_wallet.getbalance(), encrypted_wallet.getbalance())
|
||||||
|
|
Loading…
Add table
Reference in a new issue