Skip to content

Commit

Permalink
Add wait_for_tx function to DashTestFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Dec 5, 2019
1 parent e7cc24c commit 253ba29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,15 @@ def create_raw_tx(self, node_from, node_to, amount, min_inputs, max_inputs):
ret = {**decoded, **ret}
return ret

def wait_for_tx(self, txid, node, expected=True, timeout=10):
def check_tx():
try:
return node.getrawtransaction(txid)
except:
return False
if wait_until(check_tx, timeout=timeout, sleep=0.5, do_assert=expected) and not expected:
raise AssertionError("waiting unexpectedly succeeded")

def wait_for_instantlock(self, txid, node, expected=True, timeout=10):
def check_instantlock():
try:
Expand Down

0 comments on commit 253ba29

Please sign in to comment.