Skip to content

Commit 7500bf8

Browse files
committed
fix (wait_for_transaction_id)
1 parent 85288cf commit 7500bf8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tronapi/trx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ def get_transaction_from_block(self, block: Any, index: int = 0):
100100

101101
return transactions[index]
102102

103-
def wait_for_transaction_id(self, transaction_hash: str, timeout: int = 120):
103+
def wait_for_transaction_id(self,
104+
transaction_hash: str,
105+
timeout: int=120,
106+
poll_latency: (int, float)=0.2):
104107
"""
105108
Waits for the transaction specified by transaction_hash
106109
to be included in a block, then returns its transaction receipt.
@@ -113,10 +116,11 @@ def wait_for_transaction_id(self, transaction_hash: str, timeout: int = 120):
113116
Args:
114117
transaction_hash (str): Transaction Hash
115118
timeout (int): TimeOut
119+
poll_latency (any): between subsequent requests
116120
117121
"""
118122
try:
119-
return wait_for_transaction_id(self.tron, transaction_hash, timeout)
123+
return wait_for_transaction_id(self.tron, transaction_hash, timeout, poll_latency)
120124
except TimeoutError:
121125
raise TimeExhausted(
122126
"Transaction {} is not in the chain, after {} seconds".format(

0 commit comments

Comments
 (0)