diff --git a/hmt_escrow/eth_bridge.py b/hmt_escrow/eth_bridge.py index 7c109eaf..3a1f279b 100644 --- a/hmt_escrow/eth_bridge.py +++ b/hmt_escrow/eth_bridge.py @@ -32,7 +32,8 @@ KVSTORE_CONTRACT = Web3.toChecksumAddress( os.getenv("KVSTORE_CONTRACT", "0xbcF8274FAb0cbeD0099B2cAFe862035a6217Bf44")) -WEB3_POLL_LATENCY = os.getenv("WEB3_POLL_LATENCY", 5) +WEB3_POLL_LATENCY = float(os.getenv("WEB3_POLL_LATENCY", 5)) +WEB3_TIMEOUT = int(os.getenv("WEB3_TIMEOUT", 240)) def get_w3() -> Web3: @@ -112,10 +113,8 @@ def handle_transaction(txn_func, *args, **kwargs) -> AttributeDict: txn_hash = w3.eth.sendRawTransaction(signed_txn.rawTransaction) try: - txn_receipt = wait_for_transaction_receipt(w3, - txn_hash, - timeout=240, - poll_latency=5) + txn_receipt = wait_for_transaction_receipt( + w3, txn_hash, timeout=WEB3_TIMEOUT, poll_latency=WEB3_POLL_LATENCY) except TimeoutError as e: raise e return txn_receipt