Skip to content

Commit

Permalink
More error reporting what goes wrong with geth replies in the case we…
Browse files Browse the repository at this point in the history
… do not get a result. Probably some sort of race condition in geth.
  • Loading branch information
miohtama committed Jan 5, 2018
1 parent 1134b16 commit cd2d01b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ico/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def check_succesful_tx(web3: Web3, txid: str, timeout=600) -> dict:
receipt = wait_for_transaction_receipt(web3, txid, timeout=timeout)
txinfo = web3.eth.getTransaction(txid)

if receipt is None:
raise RuntimeError("Did not get receipt for {}".format(txid))

if txinfo is None:
raise RuntimeError("Did not get txinfo for {}".format(txid))

# EVM has only one error mode and it's consume all gas
if txinfo["gas"] == receipt["gasUsed"]:
raise TransactionFailure("Transaction failed: {}".format(txid))
Expand Down

0 comments on commit cd2d01b

Please sign in to comment.