diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-09-30 16:48:04 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-09-30 16:48:04 +0200 |
commit | 136d96b71f94bde2c7471ed852d447ec008e3a30 (patch) | |
tree | de8d21399cbd03fd5652824de4103b02611299f4 /test/functional/p2p_fingerprint.py | |
parent | 72affcb16cad45bd9e08ca163b2147fd01b84b70 (diff) |
test: use wait_for_{block,header} helpers in p2p_fingerprint.py
Diffstat (limited to 'test/functional/p2p_fingerprint.py')
-rwxr-xr-x | test/functional/p2p_fingerprint.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/functional/p2p_fingerprint.py b/test/functional/p2p_fingerprint.py index aaf862e6c8..332f1ca050 100755 --- a/test/functional/p2p_fingerprint.py +++ b/test/functional/p2p_fingerprint.py @@ -101,13 +101,11 @@ class P2PFingerprintTest(BitcoinTestFramework): # Check that getdata request for stale block succeeds self.send_block_request(stale_hash, node0) - test_function = lambda: self.last_block_equals(stale_hash, node0) - self.wait_until(test_function, timeout=3) + node0.wait_for_block(stale_hash, timeout=3) # Check that getheader request for stale block header succeeds self.send_header_request(stale_hash, node0) - test_function = lambda: self.last_header_equals(stale_hash, node0) - self.wait_until(test_function, timeout=3) + node0.wait_for_header(hex(stale_hash), timeout=3) # Longest chain is extended so stale is much older than chain tip self.nodes[0].setmocktime(0) @@ -137,12 +135,10 @@ class P2PFingerprintTest(BitcoinTestFramework): node0.sync_with_ping() self.send_block_request(block_hash, node0) - test_function = lambda: self.last_block_equals(block_hash, node0) - self.wait_until(test_function, timeout=3) + node0.wait_for_block(block_hash, timeout=3) self.send_header_request(block_hash, node0) - test_function = lambda: self.last_header_equals(block_hash, node0) - self.wait_until(test_function, timeout=3) + node0.wait_for_header(hex(block_hash), timeout=3) if __name__ == '__main__': P2PFingerprintTest().main() |