aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-05-06 12:20:50 +0200
committerMarcoFalke <falke.marco@gmail.com>2017-05-06 12:21:01 +0200
commit170bc2c381f86a523de2fc8b71d62ade66303c0d (patch)
treee6728fff792cbeb0e329319ad2d5c2062ae9dd83 /test/functional/test_framework
parent314ebdfcb38d4b4c977579f787d5e1a20d068c94 (diff)
parent3e3c22f09d37169fa88327323c3755be6dbd9a62 (diff)
downloadbitcoin-170bc2c381f86a523de2fc8b71d62ade66303c0d.tar.xz
Merge #10318: [tests] fix wait_for_inv()
3e3c22f [tests] fix wait_for_inv() (John Newbery) Tree-SHA512: b8070b8461e9c792cc3d9c17fd9d3faf87f550c7c0fc1788e0cd382f0794932b70cc87d480805a3b3c1ca2fdca9f8f1bcb9759300d777d9aaa8d41c016260d93
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-xtest/functional/test_framework/mininode.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py
index 03db0d1092..70bba566c7 100755
--- a/test/functional/test_framework/mininode.py
+++ b/test/functional/test_framework/mininode.py
@@ -1604,7 +1604,12 @@ class NodeConnCB(object):
assert wait_until(test_function, timeout=timeout)
def wait_for_inv(self, expected_inv, timeout=60):
- test_function = lambda: self.last_message.get("inv") and self.last_message["inv"] != expected_inv
+ """Waits for an INV message and checks that the first inv object in the message was as expected."""
+ if len(expected_inv) > 1:
+ raise NotImplementedError("wait_for_inv() will only verify the first inv object")
+ test_function = lambda: self.last_message.get("inv") and \
+ self.last_message["inv"].inv[0].type == expected_inv[0].type and \
+ self.last_message["inv"].inv[0].hash == expected_inv[0].hash
assert wait_until(test_function, timeout=timeout)
def wait_for_verack(self, timeout=60):