Skip to content

Commit 8879f57

Browse files
committed
fix (wait_for_transaction_id)
1 parent 7500bf8 commit 8879f57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tronapi/trx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def get_transaction_from_block(self, block: Any, index: int = 0):
102102

103103
def wait_for_transaction_id(self,
104104
transaction_hash: str,
105-
timeout: int=120,
106-
poll_latency: (int, float)=0.2):
105+
timeout=120,
106+
poll_latency=0.2):
107107
"""
108108
Waits for the transaction specified by transaction_hash
109109
to be included in a block, then returns its transaction receipt.
@@ -120,6 +120,9 @@ def wait_for_transaction_id(self,
120120
121121
"""
122122
try:
123+
if poll_latency > timeout:
124+
poll_latency = timeout
125+
123126
return wait_for_transaction_id(self.tron, transaction_hash, timeout, poll_latency)
124127
except TimeoutError:
125128
raise TimeExhausted(

0 commit comments

Comments
 (0)