vechain / web3-gear

Proxy Thor's RESTful API to Eth JSON-RPC, to support Remix, Truffle and more.
MIT License
30 stars 17 forks source link

RuntimeWarning: coroutine 'eth_getTransactionByHash' was never awaited #34

Open andrewklau opened 4 years ago

andrewklau commented 4 years ago

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 commented 4 years ago

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

haniyeh-habibi commented 2 years ago

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

haniyeh-habibi commented 2 years ago

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