test: Get rid of default wallet hacks

- Get rid of hardcoded wallet "" names and -wallet="" args
- Get rid of setup_nodes (-wallet, -nowallet, -disablewallet) argument rewriting

Motivation:

- Simplify test framework behavior so it's easier to write new tests without
  having arguments mangled by the framework
- Make tests more readable, replacing unexplained "" string literals with
  default_wallet_name references
- Make it trivial to update default wallet name and wallet data filename for
  sqlite #19077 testing
- Stop relying on -wallet arguments to create wallets, so it is easy to change
  -wallet option in the future to only load existing wallets not create new
  ones (to avoid accidental wallet creation, and encourage use of wallet
  encryption and descriptor features)
This commit is contained in:
Russell Yanofsky
2020-09-28 20:24:06 -04:00
parent ed3acda33b
commit c1585bca8d
17 changed files with 57 additions and 57 deletions

View File

@ -151,7 +151,7 @@ class ImportRescanTest(BitcoinTestFramework):
self.skip_if_no_wallet()
def setup_network(self):
self.extra_args = [["-wallet="] for _ in range(self.num_nodes)]
self.extra_args = [[] for _ in range(self.num_nodes)]
for i, import_node in enumerate(IMPORT_NODES, 2):
if import_node.prune:
self.extra_args[i] += ["-prune=1"]
@ -159,9 +159,8 @@ class ImportRescanTest(BitcoinTestFramework):
self.add_nodes(self.num_nodes, extra_args=self.extra_args)
# Import keys with pruning disabled
self.start_nodes(extra_args=[["-wallet="]] * self.num_nodes)
for n in self.nodes:
n.importprivkey(privkey=n.get_deterministic_priv_key().key, label='coinbase')
self.start_nodes(extra_args=[[]] * self.num_nodes)
self.import_deterministic_coinbase_privkeys()
self.stop_nodes()
self.start_nodes()