diff options
| author | MarcoFalke <[email protected]> | 2019-05-09 10:42:56 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-05-16 16:15:51 -0400 |
| commit | 3460555f4711fc9d2ac3d783e30fae00c052b179 (patch) | |
| tree | a0f26a26ac7c2ce23e815f58508c53db667adc15 /test/functional/test_framework | |
| parent | test: Format predicate source as multiline on error (diff) | |
| download | discoin-3460555f4711fc9d2ac3d783e30fae00c052b179.tar.xz discoin-3460555f4711fc9d2ac3d783e30fae00c052b179.zip | |
test: Add test for p2p_blocksonly
Github-Pull: #15990
Rebased-From: fa320de79faaca2b088fcbe7f76701faa9bff236
Diffstat (limited to 'test/functional/test_framework')
| -rwxr-xr-x | test/functional/test_framework/mininode.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index ac7cc068b..6afdd5017 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -364,6 +364,14 @@ class P2PInterface(P2PConnection): # Message receiving helper methods + def wait_for_tx(self, txid, timeout=60): + def test_function(): + if not self.last_message.get('tx'): + return False + return self.last_message['tx'].tx.rehash() == txid + + wait_until(test_function, timeout=timeout, lock=mininode_lock) + def wait_for_block(self, blockhash, timeout=60): test_function = lambda: self.last_message.get("block") and self.last_message["block"].block.rehash() == blockhash wait_until(test_function, timeout=timeout, lock=mininode_lock) |