Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with exception on failed transaction in block #4

Merged
merged 1 commit into from
Nov 19, 2019

Conversation

sdrozdkov
Copy link
Contributor

I found this bug on Ropsten network.
In loop when we found bad transaction in block (failed due contract execution for example) we get exception and block processing will stacked on failed block.

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django_ethereum_events/tasks.py", line 51, in event_listener
    listener.execute()
  File "/usr/local/lib/python3.7/site-packages/django_ethereum_events/event_listener.py", line 137, in execute
    logs = self.get_block_logs(block)
  File "/usr/local/lib/python3.7/site-packages/django_ethereum_events/event_listener.py", line 64, in get_block_logs
    for log in receipt.get('logs', []):
AttributeError: 'NoneType' object has no attribute 'get'

Also this one block will be never processed: https://ropsten.etherscan.io/txs?block=6422276

I think we can easily fix this if will ignore failed transactions.

@sdrozdkov
Copy link
Contributor Author

@artemistomaras could you please review PR, at this time without typo :)

@artemistomaras artemistomaras merged commit 4135698 into artemistomaras:master Nov 19, 2019
@artemistomaras
Copy link
Owner

@sdrozdkov thank you for your contribution again and sorry that it took me so long.

I also released 3.0.2 on PyPI based on your pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants