Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

RuntimeWarning: coroutine 'eth_getTransactionByHash' was never awaited #34

Open
andrewklau opened this issue Dec 4, 2019 · 3 comments

Comments

@andrewklau
Copy link

Error on latest build from master

TypeError: Object of type 'coroutine' is not JSON serializable
/usr/lib/python3.6/asyncio/base_events.py:1452: RuntimeWarning: coroutine 'eth_getTransactionByHash' was never awaited
  handle = None  # Needed to break cycles when an exception occurs.
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_urldispatcher.py", line 158, in handler_wrapper
    return await result
  File "/usr/local/lib/python3.6/dist-packages/gear/cli.py", line 22, in handle
    response = await async_dispatch(request, basic_logging=logging, debug=debug)
  File "/usr/local/lib/python3.6/dist-packages/jsonrpcserver/async_dispatcher.py", line 103, in dispatch
    log_response(str(response), trim_log_values=trim_log_values)
  File "/usr/local/lib/python3.6/dist-packages/jsonrpcserver/response.py", line 133, in __str__
    return json.dumps(sort_dict_response(self.deserialized()))
  File "/usr/lib/python3.6/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.6/json/encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'coroutine' is not JSON serializable

uldaman added a commit that referenced this issue Dec 5, 2019
@uldaman
Copy link
Contributor

uldaman commented Dec 5, 2019

Did you use the eth_getBlockByXX api, and the second argument was True?

@haniyeh-habibi
Copy link

i have this problem too, and yes i used eth_getBlockByNumber.

@haniyeh-habibi
Copy link

RuntimeWarning: coroutine 'eth_getBlockByNumber' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

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

No branches or pull requests

3 participants