From 20a9173717b1aa0d0706894f8bda47492e1d71a9 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 19 Dec 2023 12:21:41 -0500 Subject: [PATCH] test: Remove legacy wallet tests from wallet_reindex.py --- test/functional/test_runner.py | 3 +-- test/functional/wallet_reindex.py | 19 +++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index a8e3d0c6b1b..d7bebaafc3a 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -216,8 +216,7 @@ BASE_SCRIPTS = [ 'wallet_createwallet.py --descriptors', 'wallet_watchonly.py --legacy-wallet', 'wallet_watchonly.py --usecli --legacy-wallet', - 'wallet_reindex.py --legacy-wallet', - 'wallet_reindex.py --descriptors', + 'wallet_reindex.py', 'wallet_reorgsrestore.py', 'interface_http.py', 'interface_rpc.py', diff --git a/test/functional/wallet_reindex.py b/test/functional/wallet_reindex.py index 6778f76efc0..66993665621 100755 --- a/test/functional/wallet_reindex.py +++ b/test/functional/wallet_reindex.py @@ -57,18 +57,13 @@ class WalletReindexTest(BitcoinTestFramework): # Depending on the wallet type, the birth time changes. 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. - 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) + # 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) # Rescan the wallet to detect the missing transaction wallet_watch_only.rescanblockchain() 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 with node.assert_debug_log(expected_msgs=["initload thread exit"]): @@ -81,12 +76,8 @@ class WalletReindexTest(BitcoinTestFramework): assert_equal(tx_info['confirmations'], 50) # 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 - 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) + # For descriptors, verify the wallet updated the birth time to the transaction time + assert_equal(tx_info['time'], wallet_watch_only.getwalletinfo()['birthtime']) wallet_watch_only.unloadwallet()