Skip to content

Commit

Permalink
Minor update to docstrings for #3216
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Feb 1, 2024
1 parent 5af6781 commit 91aa57b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web3/_utils/error_formatters_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def raise_contract_logic_error_on_revert(response: RPCResponse) -> RPCResponse:

def raise_transaction_indexing_error_if_indexing(response: RPCResponse) -> RPCResponse:
"""
Raise an error if ``eth_getTransactionReceipt`` returns a response indicating that
Raise an error if ``eth_getTransactionReceipt`` returns an error indicating that
transactions are still being indexed.
"""

Expand Down
13 changes: 9 additions & 4 deletions web3/_utils/module_testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,21 @@ def test_my_w3(w3, request_mocker):
async def test_my_w3(async_w3, request_mocker):
def _iter_responses():
yield {"error": {"code": -32000, "message": "indexing in progress"}}
yield {"error": {"code": -32000, "message": "indexing in progress"}}
yield {"result": "0x1"}
while True:
yield {"error": {"message": "transaction indexing in progress"}}
yield {"error": {"message": "transaction indexing in progress"}}
yield {"result": {"status": "0x1"}}
iter_responses = _iter_responses()
async with request_mocker(
async_w3,
mock_responses={"eth_getTransactionReceipt": next(iter_responses)}
mock_responses={
"eth_getTransactionReceipt": lambda *_: next(iter_responses)
},
):
# assert that the first two error responses are handled and the result
# is eventually returned when present
assert await w3.eth.get_transaction_receipt("0x1") == "0x1"
Expand Down

0 comments on commit 91aa57b

Please sign in to comment.