aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_blockchain.py
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-06-14 13:00:11 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-06-21 08:49:18 +0200
commitaaaa3aefbdfca1c9243057eeefdc19940e60bf18 (patch)
tree0487012bb53a2f37cea400f843bd94255c676457 /test/functional/rpc_blockchain.py
parentdddd89962b26b5593860d016586ee8feb5aeea24 (diff)
downloadbitcoin-aaaa3aefbdfca1c9243057eeefdc19940e60bf18.tar.xz
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.
Diffstat (limited to 'test/functional/rpc_blockchain.py')
-rwxr-xr-xtest/functional/rpc_blockchain.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py
index 6022042c11..5f2bece733 100755
--- a/test/functional/rpc_blockchain.py
+++ b/test/functional/rpc_blockchain.py
@@ -49,7 +49,6 @@ from test_framework.util import (
assert_raises_rpc_error,
assert_is_hex_string,
assert_is_hash_string,
- get_datadir_path,
)
from test_framework.wallet import MiniWallet
@@ -572,16 +571,15 @@ class BlockchainTest(BitcoinTestFramework):
self.log.info("Test that getblock with verbosity 3 includes prevout")
assert_vin_contains_prevout(3)
- self.log.info("Test that getblock with verbosity 2 and 3 still works with pruned Undo data")
- datadir = get_datadir_path(self.options.tmpdir, 0)
-
self.log.info("Test getblock with invalid verbosity type returns proper error message")
assert_raises_rpc_error(-3, "JSON value of type string is not of expected type number", node.getblock, blockhash, "2")
+ 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 = os.path.join(datadir, self.chain, 'blocks', old)
- new_path = os.path.join(datadir, self.chain, 'blocks', new)
- os.rename(old_path, new_path)
+ old_path = self.nodes[0].chain_path / "blocks" / old
+ new_path = self.nodes[0].chain_path / "blocks" / new
+ old_path.rename(new_path)
# Move instead of deleting so we can restore chain state afterwards
move_block_file('rev00000.dat', 'rev_wrong')