Waits for an INV message and checks that the first inv object in the message was as expected.
(self, expected_inv, *, timeout=60)
| 683 | self.wait_until(test_function, timeout=timeout) |
| 684 | |
| 685 | def wait_for_inv(self, expected_inv, *, timeout=60): |
| 686 | """Waits for an INV message and checks that the first inv object in the message was as expected.""" |
| 687 | if len(expected_inv) > 1: |
| 688 | raise NotImplementedError("wait_for_inv() will only verify the first inv object") |
| 689 | |
| 690 | def test_function(): |
| 691 | return self.last_message.get("inv") and \ |
| 692 | self.last_message["inv"].inv[0].type == expected_inv[0].type and \ |
| 693 | self.last_message["inv"].inv[0].hash == expected_inv[0].hash |
| 694 | |
| 695 | self.wait_until(test_function, timeout=timeout) |
| 696 | |
| 697 | def wait_for_verack(self, *, timeout=60): |
| 698 | def test_function(): |