You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running our test suite web3 crashes when estimating time based gas price. Probably it is caused by not having any transactions in our test chain. However when probabilities are calculated they are empty (empty tuple) which causes then an Index Error in '104, in _compute_gas_price\r\n first = probabilities[0]\r\nIndexError: tuple index out of range\
It might be the case that there is a problem with our geth client during runtime.
File “/home/circleci/raiden/raiden/network/rpc/client.py”, line 346, in gas_price
return int(self.web3.eth.generateGasPrice())
File “/home/circleci/venv-3.7/lib/python3.7/site-packages/web3/eth.py”, line 385, in generateGasPrice
return self.gasPriceStrategy(self.web3, transaction_params)
File “/home/circleci/venv-3.7/lib/python3.7/site-packages/web3/gas_strategies/time_based.py”, line 168, in time_based_gas_price_strategy
gas_price = _compute_gas_price(probabilities, probability / 100)
File “/home/circleci/venv-3.7/lib/python3.7/site-packages/web3/gas_strategies/time_based.py”, line 104, in _compute_gas_price
first = probabilities[0]
IndexError: tuple index out of range
How can it be fixed?
However I would suggest handling the edge case that there is an empty tuple and not unconditionally access first = probabilities[0]
I'm happy to give more information when needed
The text was updated successfully, but these errors were encountered:
Yes, I believe this is a known issue. I'll leave it open for tracking.
I think the current solution is: don't try to estimate gas if you don't have any transactions to go on (which is obviously unsatisfying).
But, I'm also not sure what the estimate function should do otherwise. I don't think it would be appropriate to return any number, or None (requiring return value checking is bad:tm:).
The only better option I can think of is to raise a ValidationError that is clearly saying that there are no transactions to base an estimate on.
What was wrong?
Running our test suite web3 crashes when estimating time based gas price. Probably it is caused by not having any transactions in our test chain. However when probabilities are calculated they are empty (empty tuple) which causes then an Index Error in
'104, in _compute_gas_price\r\n first = probabilities[0]\r\nIndexError: tuple index out of range\
It might be the case that there is a problem with our geth client during runtime.
How can it be fixed?
However I would suggest handling the edge case that there is an empty tuple and not unconditionally access
first = probabilities[0]
I'm happy to give more information when needed
The text was updated successfully, but these errors were encountered: