aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-04-11 15:53:01 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-04-11 18:40:28 +0200
commit854382885f18aa9a95cdde3d11591b05c305ad3f (patch)
tree7339ed096397a4dec598d5117f0b74bce45b8a83 /test/functional/test_framework
parent1356a45ef042e7bd3d539fbb606d6b1be547d00f (diff)
refactor: test: improve wait_for{header,merkleblock} interface
The interfaces for the methods wait_for_header() and wait_for_merkleblock() are changed to take a hex string instead of an integer, improving type safety and removing the burden from the caller to always do the transformation via `int(...)`. As suggested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/18593#discussion_r407062253
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-xtest/functional/test_framework/mininode.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py
index b17254faf8..beda7eeaba 100755
--- a/test/functional/test_framework/mininode.py
+++ b/test/functional/test_framework/mininode.py
@@ -393,7 +393,7 @@ class P2PInterface(P2PConnection):
last_headers = self.last_message.get('headers')
if not last_headers:
return False
- return last_headers.headers[0].rehash() == blockhash
+ return last_headers.headers[0].rehash() == int(blockhash, 16)
wait_until(test_function, timeout=timeout, lock=mininode_lock)
@@ -403,7 +403,7 @@ class P2PInterface(P2PConnection):
last_filtered_block = self.last_message.get('merkleblock')
if not last_filtered_block:
return False
- return last_filtered_block.merkleblock.header.rehash() == blockhash
+ return last_filtered_block.merkleblock.header.rehash() == int(blockhash, 16)
wait_until(test_function, timeout=timeout, lock=mininode_lock)