mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
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:
@ -10,7 +10,6 @@
|
||||
- Verify that out-of-order blocks are correctly processed, see LoadExternalBlockFile()
|
||||
"""
|
||||
|
||||
import os
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.p2p import MAGIC_BYTES
|
||||
from test_framework.util import assert_equal
|
||||
@ -39,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 = os.path.join(self.nodes[0].datadir, self.nodes[0].chain, 'blocks', 'blk00000.dat')
|
||||
blk0 = self.nodes[0].chain_path / "blocks" / "blk00000.dat"
|
||||
with open(blk0, 'r+b') as bf:
|
||||
# Read at least the first few blocks (including genesis)
|
||||
b = bf.read(2000)
|
||||
|
Reference in New Issue
Block a user