test: Remove legacy wallet tests from wallet_reindex.py

This commit is contained in:
Ava Chow 2023-12-19 12:21:41 -05:00
parent 446d480cb2
commit 20a9173717
2 changed files with 6 additions and 16 deletions

View file

@ -216,8 +216,7 @@ BASE_SCRIPTS = [
'wallet_createwallet.py --descriptors', 'wallet_createwallet.py --descriptors',
'wallet_watchonly.py --legacy-wallet', 'wallet_watchonly.py --legacy-wallet',
'wallet_watchonly.py --usecli --legacy-wallet', 'wallet_watchonly.py --usecli --legacy-wallet',
'wallet_reindex.py --legacy-wallet', 'wallet_reindex.py',
'wallet_reindex.py --descriptors',
'wallet_reorgsrestore.py', 'wallet_reorgsrestore.py',
'interface_http.py', 'interface_http.py',
'interface_rpc.py', 'interface_rpc.py',

View file

@ -57,18 +57,13 @@ class WalletReindexTest(BitcoinTestFramework):
# Depending on the wallet type, the birth time changes. # Depending on the wallet type, the birth time changes.
wallet_birthtime = wallet_watch_only.getwalletinfo()['birthtime'] wallet_birthtime = wallet_watch_only.getwalletinfo()['birthtime']
if self.options.descriptors:
# As blocks were generated every 10 min, the chain MTP timestamp is node_time - 60 min. # As blocks were generated every 10 min, the chain MTP timestamp is node_time - 60 min.
assert_equal(self.node_time - BLOCK_TIME * 6, wallet_birthtime) assert_equal(self.node_time - BLOCK_TIME * 6, wallet_birthtime)
else:
# No way of importing scripts/addresses with a custom time on a legacy wallet.
# It's always set to the beginning of time.
assert_equal(wallet_birthtime, 1)
# Rescan the wallet to detect the missing transaction # Rescan the wallet to detect the missing transaction
wallet_watch_only.rescanblockchain() wallet_watch_only.rescanblockchain()
assert_equal(wallet_watch_only.gettransaction(tx_id)['confirmations'], 50) assert_equal(wallet_watch_only.gettransaction(tx_id)['confirmations'], 50)
assert_equal(wallet_watch_only.getbalances()['mine' if self.options.descriptors else 'watchonly']['trusted'], 2) assert_equal(wallet_watch_only.getbalances()['mine']['trusted'], 2)
# Reindex and wait for it to finish # Reindex and wait for it to finish
with node.assert_debug_log(expected_msgs=["initload thread exit"]): with node.assert_debug_log(expected_msgs=["initload thread exit"]):
@ -81,12 +76,8 @@ class WalletReindexTest(BitcoinTestFramework):
assert_equal(tx_info['confirmations'], 50) assert_equal(tx_info['confirmations'], 50)
# Depending on the wallet type, the birth time changes. # Depending on the wallet type, the birth time changes.
if self.options.descriptors:
# For descriptors, verify the wallet updated the birth time to the transaction time # For descriptors, verify the wallet updated the birth time to the transaction time
assert_equal(tx_info['time'], wallet_watch_only.getwalletinfo()['birthtime']) assert_equal(tx_info['time'], wallet_watch_only.getwalletinfo()['birthtime'])
else:
# For legacy, as the birth time was set to the beginning of time, verify it did not change
assert_equal(wallet_birthtime, 1)
wallet_watch_only.unloadwallet() wallet_watch_only.unloadwallet()