-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Catch newly raised geth errors when tx indexing in progress #3216
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
Catch newly raised geth errors when tx indexing in progress #3216
Conversation
f109627
to
7993f54
Compare
- Geth ``1.13.11`` started to return an error when transaction indexing is in progress and a ``eth_getTransactionReceipt`` call is made. Handle this in the ``wait_for_transaction_receipt`` method by catching the error in order to continue waiting.
7993f54
to
b68cd9f
Compare
b757af7
to
9435474
Compare
9435474
to
91aa57b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
i = _tx_indexing_response_iterator() | ||
with request_mocker( | ||
w3, | ||
mock_responses={"eth_getTransactionReceipt": lambda *_: next(i)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This iterator approach is really cool! 😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this is way cleaner than the v6 way! nice!
the RPC response. ``mock_errors`` is a dict mapping method names to the desired | ||
"error" object of the RPC response. If a method name is not in either dict, | ||
the request is made as usual. | ||
Example with async and a mocked response object: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 Thanks for expanding this with a nice example!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
i = _tx_indexing_response_iterator() | ||
with request_mocker( | ||
w3, | ||
mock_responses={"eth_getTransactionReceipt": lambda *_: next(i)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this is way cleaner than the v6 way! nice!
What was wrong?
Related to Issue #3212
1.13.11
started to return an error when transaction indexing is in progress and aeth_getTransactionReceipt
call is made.How was it fixed?
wait_for_transaction_receipt
method by catching the error in order to continue waiting.Todo:
Cute Animal Picture