mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +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:
@@ -9,10 +9,7 @@
|
||||
- Mine a fork that requires disconnecting the tip.
|
||||
- Verify that bitcoind AbortNode's.
|
||||
"""
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import get_datadir_path
|
||||
import os
|
||||
|
||||
|
||||
class AbortNodeTest(BitcoinTestFramework):
|
||||
@@ -26,10 +23,9 @@ class AbortNodeTest(BitcoinTestFramework):
|
||||
|
||||
def run_test(self):
|
||||
self.generate(self.nodes[0], 3, sync_fun=self.no_op)
|
||||
datadir = get_datadir_path(self.options.tmpdir, 0)
|
||||
|
||||
# Deleting the undo file will result in reorg failure
|
||||
os.unlink(os.path.join(datadir, self.chain, 'blocks', 'rev00000.dat'))
|
||||
(self.nodes[0].chain_path / "blocks" / "rev00000.dat").unlink()
|
||||
|
||||
# Connecting to a node with a more work chain will trigger a reorg
|
||||
# attempt.
|
||||
|
Reference in New Issue
Block a user