From 557b6a9618811ff0931a117d156547f9b93a2424 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Fri, 19 Jun 2020 20:04:18 -0400 Subject: [PATCH] Revert "Revert "Use env variables"" This reverts commit de385ddcbe51928efc9c866272806e89433ed525. --- hmt_escrow/eth_bridge.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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