test: Replace usage of importaddress

This commit is contained in:
Ava Chow
2025-05-08 11:48:38 -07:00
parent fcc457573f
commit d314207779
7 changed files with 34 additions and 48 deletions

View File

@@ -46,10 +46,8 @@ class WalletReindexTest(BitcoinTestFramework):
# Blank wallets don't have a birth time
assert 'birthtime' not in wallet_watch_only.getwalletinfo()
# For a descriptors wallet: Import address with timestamp=now.
# For legacy wallet: There is no way of importing a script/address with a custom time. The wallet always imports it with birthtime=1.
# In both cases, disable rescan to not detect the transaction.
wallet_watch_only.importaddress(wallet_addr, rescan=False)
# Import address with timestamp=now.
wallet_watch_only.importdescriptors([{"desc": miner_wallet.getaddressinfo(wallet_addr)["desc"], "timestamp": "now"}])
assert_equal(len(wallet_watch_only.listtransactions()), 0)
# Depending on the wallet type, the birth time changes.