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-
This commit is contained in:
MarcoFalke 2023-07-12 15:03:38 +02:00
parent fa060c15fb
commit fafe43cb6c
No known key found for this signature in database
7 changed files with 12 additions and 12 deletions

View File

@ -25,7 +25,7 @@ class AbortNodeTest(BitcoinTestFramework):
self.generate(self.nodes[0], 3, sync_fun=self.no_op)
# Deleting the undo file will result in reorg failure
(self.nodes[0].chain_path / "blocks" / "rev00000.dat").unlink()
(self.nodes[0].blocks_path / "rev00000.dat").unlink()
# Connecting to a node with a more work chain will trigger a reorg
# attempt.

View File

@ -26,7 +26,7 @@ class SymlinkTest(BitcoinTestFramework):
self.stop_node(0)
rename_and_link(
from_name=self.nodes[0].chain_path / "blocks",
from_name=self.nodes[0].blocks_path,
to_name=dir_new_blocks,
)
rename_and_link(

View File

@ -37,7 +37,7 @@ class LoadblockTest(BitcoinTestFramework):
cfg_file = os.path.join(data_dir, "linearize.cfg")
bootstrap_file = os.path.join(self.options.tmpdir, "bootstrap.dat")
genesis_block = self.nodes[0].getblockhash(0)
blocks_dir = self.nodes[0].chain_path / "blocks"
blocks_dir = self.nodes[0].blocks_path
hash_list = tempfile.NamedTemporaryFile(dir=data_dir,
mode='w',
delete=False,

View File

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

View File

@ -20,10 +20,10 @@ class FeatureRemovePrunedFilesOnStartupTest(BitcoinTestFramework):
self.sync_blocks()
def run_test(self):
blk0 = self.nodes[0].chain_path / "blocks" / "blk00000.dat"
rev0 = self.nodes[0].chain_path / "blocks" / "rev00000.dat"
blk1 = self.nodes[0].chain_path / "blocks" / "blk00001.dat"
rev1 = self.nodes[0].chain_path / "blocks" / "rev00001.dat"
blk0 = self.nodes[0].blocks_path / "blk00000.dat"
rev0 = self.nodes[0].blocks_path / "rev00000.dat"
blk1 = self.nodes[0].blocks_path / "blk00001.dat"
rev1 = self.nodes[0].blocks_path / "rev00001.dat"
self.mine_batches(800)
fo1 = os.open(blk0, os.O_RDONLY)
fo2 = os.open(rev1, os.O_RDONLY)

View File

@ -40,9 +40,9 @@ class UnsupportedUtxoDbTest(BitcoinTestFramework):
self.log.info("Check init error")
legacy_utxos_dir = self.nodes[0].chain_path / "chainstate"
legacy_blocks_dir = self.nodes[0].chain_path / "blocks"
legacy_blocks_dir = self.nodes[0].blocks_path
recent_utxos_dir = self.nodes[1].chain_path / "chainstate"
recent_blocks_dir = self.nodes[1].chain_path / "blocks"
recent_blocks_dir = self.nodes[1].blocks_path
shutil.copytree(legacy_utxos_dir, recent_utxos_dir)
shutil.copytree(legacy_blocks_dir, recent_blocks_dir)
self.nodes[1].assert_start_raises_init_error(

View File

@ -577,8 +577,8 @@ class BlockchainTest(BitcoinTestFramework):
self.log.info("Test that getblock with verbosity 2 and 3 still works with pruned Undo data")
def move_block_file(old, new):
old_path = self.nodes[0].chain_path / "blocks" / old
new_path = self.nodes[0].chain_path / "blocks" / new
old_path = self.nodes[0].blocks_path / old
new_path = self.nodes[0].blocks_path / new
old_path.rename(new_path)
# Move instead of deleting so we can restore chain state afterwards