test: Replace usage of importaddress

This commit is contained in:
Ava Chow committed 2025-05-09 11:42:46 -07:00
1 parent fcc457573f
commit d314207779
7 files changed
+34 -48

No files matched your search

+2 -4
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.