test: Remove unused options and variables, correct comments

This commit is contained in:
Ava Chow 2025-04-25 08:58:19 -07:00
parent 04a7a7a28c
commit 810476f31e
9 changed files with 9 additions and 25 deletions

View File

@ -55,7 +55,6 @@ class BIP68Test(BitcoinTestFramework):
'-testactivationheight=csv@432',
],
]
self.uses_wallet = None
def run_test(self):
self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"]

View File

@ -74,7 +74,6 @@ class RawTransactionsTest(BitcoinTestFramework):
# whitelist peers to speed up tx relay / mempool sync
self.noban_tx_relay = True
self.supports_cli = False
self.uses_wallet = None
def setup_network(self):
super().setup_network()

View File

@ -161,7 +161,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.wallet_names = None
# By default the wallet is not required. Set to true by skip_if_no_wallet().
# Can also be set to None to indicate that the wallet will be used if available.
# When False or None, we ignore wallet_names regardless of what it is.
# When False or None, we ignore wallet_names in setup_nodes().
self.uses_wallet = False
# Disable ThreadOpenConnections by default, so that adding entries to
# addrman will not result in automatic connections to them.
@ -487,10 +487,6 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
n.createwallet(wallet_name=wallet_name, load_on_startup=True)
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase', rescan=True)
# Only enables wallet support when the module is available
def enable_wallet_if_possible(self):
self._requires_wallet = self.is_wallet_compiled()
def run_test(self):
"""Tests must override this method to define test logic"""
raise NotImplementedError

View File

@ -459,7 +459,6 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
f.write("printtoconsole=0\n")
f.write("natpmp=0\n")
f.write("shrinkdebugfile=0\n")
f.write("deprecatedrpc=create_bdb\n") # Required to run the tests
# To improve SQLite wallet performance so that the tests don't timeout, use -unsafesqlitesync
f.write("unsafesqlitesync=1\n")
if disable_autoconnect:

View File

@ -29,8 +29,6 @@ import tempfile
import re
import logging
os.environ["REQUIRE_WALLET_TYPE_SET"] = "1"
# Minimum amount of space to run the tests.
MIN_FREE_SPACE = 1.1 * 1024 * 1024 * 1024
# Additional space to run an extra job.

View File

@ -20,16 +20,10 @@ from test_framework.util import (
class ToolWalletTest(BitcoinTestFramework):
def add_options(self, parser):
parser.add_argument("--bdbro", action="store_true", help="Use the BerkeleyRO internal parser when dumping a Berkeley DB wallet file")
parser.add_argument("--swap-bdb-endian", action="store_true",help="When making Legacy BDB wallets, always make then byte swapped internally")
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.rpc_timeout = 120
if self.options.swap_bdb_endian:
self.extra_args = [["-swapbdbendian"]]
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
@ -37,8 +31,6 @@ class ToolWalletTest(BitcoinTestFramework):
def bitcoin_wallet_process(self, *args):
default_args = ['-datadir={}'.format(self.nodes[0].datadir_path), '-chain=%s' % self.chain]
if "dump" in args and self.options.bdbro:
default_args.append("-withinternalbdb")
return subprocess.Popen(self.get_binaries().wallet_argv() + default_args + list(args), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)

View File

@ -15,7 +15,6 @@ from test_framework.wallet_util import generate_keypair, WalletUnlock
EMPTY_PASSPHRASE_MSG = "Empty string given as passphrase, wallet will not be encrypted."
LEGACY_WALLET_MSG = "Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future."
class CreateWalletTest(BitcoinTestFramework):
@ -27,7 +26,6 @@ class CreateWalletTest(BitcoinTestFramework):
def run_test(self):
node = self.nodes[0]
self.generate(node, 1) # Leave IBD for sethdseed
self.log.info("Run createwallet with invalid parameters.")
# Run createwallet with invalid parameters. This must not prevent a new wallet with the same name from being created with the correct parameters.

View File

@ -43,7 +43,6 @@ class WalletHDTest(BitcoinTestFramework):
# This should be enough to keep the master key and the non-HD key
self.nodes[1].backupwallet(self.nodes[1].datadir_path / "hd.bak")
#self.nodes[1].dumpwallet(self.nodes[1].datadir_path / "hd.dump")
# Derive some HD addresses and remember the last
# Also send funds to each add

View File

@ -47,10 +47,14 @@ class WalletMigrationTest(BitcoinTestFramework):
self.skip_if_no_previous_releases()
def setup_nodes(self):
self.add_nodes(self.num_nodes, versions=[
None,
280000,
])
self.add_nodes(
self.num_nodes,
extra_args=self.extra_args,
versions=[
None,
280000,
],
)
self.start_nodes()
self.init_wallet(node=0)