refactor: move read_xor_key() to TestNode

This commit is contained in:
tdb3
2024-08-20 20:03:25 -04:00
parent d43948c3ef
commit d8399584dd
4 changed files with 7 additions and 10 deletions

View File

@@ -469,6 +469,11 @@ class TestNode():
def blocks_key_path(self) -> Path:
return self.blocks_path / "xor.dat"
def read_xor_key(self) -> bytes:
with open(self.blocks_key_path, "rb") as xor_f:
NUM_XOR_BYTES = 8 # From InitBlocksdirXorKey::xor_key.size()
return xor_f.read(NUM_XOR_BYTES)
@property
def wallets_path(self) -> Path:
return self.chain_path / "wallets"

View File

@@ -515,12 +515,6 @@ def check_node_connections(*, node, num_in, num_out):
assert_equal(info["connections_out"], num_out)
def read_xor_key(*, node):
with open(node.blocks_key_path, "rb") as xor_f:
NUM_XOR_BYTES = 8 # From InitBlocksdirXorKey::xor_key.size()
return xor_f.read(NUM_XOR_BYTES)
# Transaction/Block functions
#############################