test: Use TestNode *_path properties where possible

Seems odd to place the burden on test writers to hardcode the chain or
datadir path for the nodes under test.
This commit is contained in:
MarcoFalke
2023-06-14 13:00:11 +02:00
parent dddd89962b
commit aaaa3aefbd
22 changed files with 86 additions and 108 deletions

View File

@@ -74,8 +74,8 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
def nodes_wallet_dir(self, node):
if node.version < 170000:
return os.path.join(node.datadir, "regtest")
return os.path.join(node.datadir, "regtest/wallets")
return node.chain_path
return node.wallets_path
def run_test(self):
node_miner = self.nodes[0]
@@ -157,10 +157,10 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
assert info['keypoolsize'] == 0
# Unload wallets and copy to older nodes:
node_master_wallets_dir = os.path.join(node_master.datadir, "regtest/wallets")
node_v19_wallets_dir = os.path.join(node_v19.datadir, "regtest/wallets")
node_v17_wallets_dir = os.path.join(node_v17.datadir, "regtest/wallets")
node_v16_wallets_dir = os.path.join(node_v16.datadir, "regtest")
node_master_wallets_dir = node_master.wallets_path
node_v19_wallets_dir = node_v19.wallets_path
node_v17_wallets_dir = node_v17.wallets_path
node_v16_wallets_dir = node_v16.chain_path
node_master.unloadwallet("w1")
node_master.unloadwallet("w2")
node_master.unloadwallet("w3")