mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-04 17:52:25 +01:00
scripted-diff: Use wallets_path and chain_path where possible
Instead of passing the datadir and chain name to os.path.join, just use the existing properties, which are the same. -BEGIN VERIFY SCRIPT- sed -i --regexp-extended 's|\.datadir, self\.chain, .wallets.|.wallets_path|g' $(git grep -l '\.datadir, self\.chain,') sed -i --regexp-extended 's|\.datadir, self\.chain,|.chain_path,|g' $(git grep -l '\.datadir, self\.chain,') -END VERIFY SCRIPT-
This commit is contained in:
@@ -87,11 +87,11 @@ class WalletHDTest(BitcoinTestFramework):
|
||||
self.stop_node(1)
|
||||
# we need to delete the complete chain directory
|
||||
# otherwise node1 would auto-recover all funds in flag the keypool keys as used
|
||||
shutil.rmtree(os.path.join(self.nodes[1].datadir, self.chain, "blocks"))
|
||||
shutil.rmtree(os.path.join(self.nodes[1].datadir, self.chain, "chainstate"))
|
||||
shutil.rmtree(os.path.join(self.nodes[1].chain_path, "blocks"))
|
||||
shutil.rmtree(os.path.join(self.nodes[1].chain_path, "chainstate"))
|
||||
shutil.copyfile(
|
||||
os.path.join(self.nodes[1].datadir, "hd.bak"),
|
||||
os.path.join(self.nodes[1].datadir, self.chain, 'wallets', self.default_wallet_name, self.wallet_data_filename),
|
||||
os.path.join(self.nodes[1].wallets_path, self.default_wallet_name, self.wallet_data_filename),
|
||||
)
|
||||
self.start_node(1)
|
||||
|
||||
@@ -115,11 +115,11 @@ class WalletHDTest(BitcoinTestFramework):
|
||||
|
||||
# Try a RPC based rescan
|
||||
self.stop_node(1)
|
||||
shutil.rmtree(os.path.join(self.nodes[1].datadir, self.chain, "blocks"))
|
||||
shutil.rmtree(os.path.join(self.nodes[1].datadir, self.chain, "chainstate"))
|
||||
shutil.rmtree(os.path.join(self.nodes[1].chain_path, "blocks"))
|
||||
shutil.rmtree(os.path.join(self.nodes[1].chain_path, "chainstate"))
|
||||
shutil.copyfile(
|
||||
os.path.join(self.nodes[1].datadir, "hd.bak"),
|
||||
os.path.join(self.nodes[1].datadir, self.chain, "wallets", self.default_wallet_name, self.wallet_data_filename),
|
||||
os.path.join(self.nodes[1].wallets_path, self.default_wallet_name, self.wallet_data_filename),
|
||||
)
|
||||
self.start_node(1, extra_args=self.extra_args[1])
|
||||
self.connect_nodes(0, 1)
|
||||
|
||||
Reference in New Issue
Block a user