Skip to content

Commit fafe43c

Browse files
author
MarcoFalke
committed
scripted-diff: Use blocks_path where possible
-BEGIN VERIFY SCRIPT- sed -i 's|].chain_path / "blocks"|].blocks_path|g' $(git grep -l chain_path) -END VERIFY SCRIPT-
1 parent fa060c1 commit fafe43c

7 files changed

+12
-12
lines changed

Diff for: test/functional/feature_abortnode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def run_test(self):
2525
self.generate(self.nodes[0], 3, sync_fun=self.no_op)
2626

2727
# Deleting the undo file will result in reorg failure
28-
(self.nodes[0].chain_path / "blocks" / "rev00000.dat").unlink()
28+
(self.nodes[0].blocks_path / "rev00000.dat").unlink()
2929

3030
# Connecting to a node with a more work chain will trigger a reorg
3131
# attempt.

Diff for: test/functional/feature_dirsymlinks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def run_test(self):
2626
self.stop_node(0)
2727

2828
rename_and_link(
29-
from_name=self.nodes[0].chain_path / "blocks",
29+
from_name=self.nodes[0].blocks_path,
3030
to_name=dir_new_blocks,
3131
)
3232
rename_and_link(

Diff for: test/functional/feature_loadblock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run_test(self):
3737
cfg_file = os.path.join(data_dir, "linearize.cfg")
3838
bootstrap_file = os.path.join(self.options.tmpdir, "bootstrap.dat")
3939
genesis_block = self.nodes[0].getblockhash(0)
40-
blocks_dir = self.nodes[0].chain_path / "blocks"
40+
blocks_dir = self.nodes[0].blocks_path
4141
hash_list = tempfile.NamedTemporaryFile(dir=data_dir,
4242
mode='w',
4343
delete=False,

Diff for: test/functional/feature_reindex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def out_of_order(self):
3838
# In this test environment, blocks will always be in order (since
3939
# we're generating them rather than getting them from peers), so to
4040
# test out-of-order handling, swap blocks 1 and 2 on disk.
41-
blk0 = self.nodes[0].chain_path / "blocks" / "blk00000.dat"
41+
blk0 = self.nodes[0].blocks_path / "blk00000.dat"
4242
with open(blk0, 'r+b') as bf:
4343
# Read at least the first few blocks (including genesis)
4444
b = bf.read(2000)

Diff for: test/functional/feature_remove_pruned_files_on_startup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def mine_batches(self, blocks):
2020
self.sync_blocks()
2121

2222
def run_test(self):
23-
blk0 = self.nodes[0].chain_path / "blocks" / "blk00000.dat"
24-
rev0 = self.nodes[0].chain_path / "blocks" / "rev00000.dat"
25-
blk1 = self.nodes[0].chain_path / "blocks" / "blk00001.dat"
26-
rev1 = self.nodes[0].chain_path / "blocks" / "rev00001.dat"
23+
blk0 = self.nodes[0].blocks_path / "blk00000.dat"
24+
rev0 = self.nodes[0].blocks_path / "rev00000.dat"
25+
blk1 = self.nodes[0].blocks_path / "blk00001.dat"
26+
rev1 = self.nodes[0].blocks_path / "rev00001.dat"
2727
self.mine_batches(800)
2828
fo1 = os.open(blk0, os.O_RDONLY)
2929
fo2 = os.open(rev1, os.O_RDONLY)

Diff for: test/functional/feature_unsupported_utxo_db.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def run_test(self):
4040

4141
self.log.info("Check init error")
4242
legacy_utxos_dir = self.nodes[0].chain_path / "chainstate"
43-
legacy_blocks_dir = self.nodes[0].chain_path / "blocks"
43+
legacy_blocks_dir = self.nodes[0].blocks_path
4444
recent_utxos_dir = self.nodes[1].chain_path / "chainstate"
45-
recent_blocks_dir = self.nodes[1].chain_path / "blocks"
45+
recent_blocks_dir = self.nodes[1].blocks_path
4646
shutil.copytree(legacy_utxos_dir, recent_utxos_dir)
4747
shutil.copytree(legacy_blocks_dir, recent_blocks_dir)
4848
self.nodes[1].assert_start_raises_init_error(

Diff for: test/functional/rpc_blockchain.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ def assert_vin_does_not_contain_prevout(verbosity):
577577
self.log.info("Test that getblock with verbosity 2 and 3 still works with pruned Undo data")
578578

579579
def move_block_file(old, new):
580-
old_path = self.nodes[0].chain_path / "blocks" / old
581-
new_path = self.nodes[0].chain_path / "blocks" / new
580+
old_path = self.nodes[0].blocks_path / old
581+
new_path = self.nodes[0].blocks_path / new
582582
old_path.rename(new_path)
583583

584584
# Move instead of deleting so we can restore chain state afterwards

0 commit comments

Comments
 (0)