Skip to content

Commit 91aa57b

Browse files
committed
Minor update to docstrings for #3216
1 parent 5af6781 commit 91aa57b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

web3/_utils/error_formatters_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def raise_contract_logic_error_on_revert(response: RPCResponse) -> RPCResponse:
169169

170170
def raise_transaction_indexing_error_if_indexing(response: RPCResponse) -> RPCResponse:
171171
"""
172-
Raise an error if ``eth_getTransactionReceipt`` returns a response indicating that
172+
Raise an error if ``eth_getTransactionReceipt`` returns an error indicating that
173173
transactions are still being indexed.
174174
"""
175175

web3/_utils/module_testing/utils.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,21 @@ def test_my_w3(w3, request_mocker):
4949
5050
async def test_my_w3(async_w3, request_mocker):
5151
def _iter_responses():
52-
yield {"error": {"code": -32000, "message": "indexing in progress"}}
53-
yield {"error": {"code": -32000, "message": "indexing in progress"}}
54-
yield {"result": "0x1"}
52+
while True:
53+
yield {"error": {"message": "transaction indexing in progress"}}
54+
yield {"error": {"message": "transaction indexing in progress"}}
55+
yield {"result": {"status": "0x1"}}
5556
5657
iter_responses = _iter_responses()
5758
5859
async with request_mocker(
5960
async_w3,
60-
mock_responses={"eth_getTransactionReceipt": next(iter_responses)}
61+
mock_responses={
62+
"eth_getTransactionReceipt": lambda *_: next(iter_responses)
63+
},
6164
):
65+
# assert that the first two error responses are handled and the result
66+
# is eventually returned when present
6267
assert await w3.eth.get_transaction_receipt("0x1") == "0x1"
6368
6469

0 commit comments

Comments
 (0)