mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Merge #10318: [tests] fix wait_for_inv()
3e3c22f
[tests] fix wait_for_inv() (John Newbery)
Tree-SHA512: b8070b8461e9c792cc3d9c17fd9d3faf87f550c7c0fc1788e0cd382f0794932b70cc87d480805a3b3c1ca2fdca9f8f1bcb9759300d777d9aaa8d41c016260d93
This commit is contained in:
parent
8c420c2983
commit
d6e83980da
0
test/functional/p2p-segwit.py
Executable file
0
test/functional/p2p-segwit.py
Executable file
@ -1737,7 +1737,12 @@ class NodeConnCB(object):
|
|||||||
assert wait_until(test_function, timeout=timeout)
|
assert wait_until(test_function, timeout=timeout)
|
||||||
|
|
||||||
def wait_for_inv(self, expected_inv, timeout=60):
|
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)
|
assert wait_until(test_function, timeout=timeout)
|
||||||
|
|
||||||
def wait_for_verack(self, timeout=60):
|
def wait_for_verack(self, timeout=60):
|
||||||
|
Loading…
Reference in New Issue
Block a user