Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/mininode.py
Show First 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | class P2PInterface(P2PConnection): | ||||
def on_version(self, message): | def on_version(self, message): | ||||
assert message.nVersion >= MIN_VERSION_SUPPORTED, "Version {} received. Test framework only supports versions greater than {}".format( | assert message.nVersion >= MIN_VERSION_SUPPORTED, "Version {} received. Test framework only supports versions greater than {}".format( | ||||
message.nVersion, MIN_VERSION_SUPPORTED) | message.nVersion, MIN_VERSION_SUPPORTED) | ||||
self.send_message(msg_verack()) | self.send_message(msg_verack()) | ||||
self.nServices = message.nServices | self.nServices = message.nServices | ||||
# Connection helper methods | # Connection helper methods | ||||
def wait_until(self, test_function, timeout): | def wait_until(self, test_function, timeout=60): | ||||
wait_until(test_function, timeout=timeout, lock=mininode_lock, | wait_until(test_function, timeout=timeout, lock=mininode_lock, | ||||
timeout_factor=self.timeout_factor) | timeout_factor=self.timeout_factor) | ||||
def wait_for_disconnect(self, timeout=60): | def wait_for_disconnect(self, timeout=60): | ||||
def test_function(): return not self.is_connected | def test_function(): return not self.is_connected | ||||
self.wait_until(test_function, timeout=timeout) | self.wait_until(test_function, timeout=timeout) | ||||
# Message receiving helper methods | # Message receiving helper methods | ||||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |