mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 06:49:38 -04:00
test: Remove legacy wallet tests from wallet_reindex.py
This commit is contained in:
parent
446d480cb2
commit
20a9173717
2 changed files with 6 additions and 16 deletions
|
@ -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',
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue