tests: Check that the last hardened cache upgrade occurs

When loading an older wallet without the last hardened cache, an
automatic upgrade should be performed. Check this in
wallet_backwards_compatibility.py

When migrating a wallet, the migrated wallet should always have the last
hardened cache, so verify in wallet_migration.py
This commit is contained in:
Ava Chow
2025-07-21 13:41:36 -07:00
parent 00604296e1
commit 8a08eef645
3 changed files with 66 additions and 14 deletions

View File

@@ -1082,3 +1082,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if self.options.usecli:
return json.dumps(text)
return text
def inspect_sqlite_db(self, path, fn, *args, **kwargs):
try:
import sqlite3 # type: ignore[import]
conn = sqlite3.connect(path)
with conn:
result = fn(conn, *args, **kwargs)
conn.close()
return result
except ImportError:
self.log.warning("sqlite3 module not available, skipping tests that inspect the database")