janezpodhostnik / flow-py-sdk

Unofficial flow blockchain python sdk
MIT License
35 stars 26 forks source link

Error calling get_account #39

Closed timnugent closed 1 year ago

timnugent commented 2 years ago

Dependencies installed with poetry. Fails on the get_account method:

account = await client.get_account( address=Address.from_hex("0x40a3d1b2460658b0") )

Traceback (most recent call last): File "/Users/tnugent/src/bloctoswap/./blocto-test.py", line 223, in loop.run_until_complete(run3(ctx)) File "/usr/local/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete return future.result() File "/Users/tnugent/src/bloctoswap/./blocto-test.py", line 178, in run3 account = await client.get_account( File "/usr/local/lib/python3.10/site-packages/flow_py_sdk/client/client.py", line 212, in get_account response = await super().get_account(address=address) File "/usr/local/lib/python3.10/site-packages/flow_py_sdk/proto/flow/access.py", line 346, in get_account return await self._unary_unary( File "/usr/local/lib/python3.10/site-packages/betterproto/init.py", line 1123, in _unary_unary await stream.send_message(request, end=True) File "/usr/local/lib/python3.10/site-packages/grpclib/client.py", line 255, in send_message await send_message(self._stream, self._codec, message, File "/usr/local/lib/python3.10/site-packages/grpclib/stream.py", line 44, in send_message reply_bin = codec.encode(message, message_type) File "/usr/local/lib/python3.10/site-packages/grpclib/encoding/proto.py", line 47, in encode return message.SerializeToString() File "/usr/local/lib/python3.10/site-packages/betterproto/init.py", line 624, in bytes output += _serialize_single( File "/usr/local/lib/python3.10/site-packages/betterproto/init.py", line 373, in _serialize_single if len(value) or serialize_empty or wraps: TypeError: object of type 'Address' has no len()

heyfez commented 2 years ago

Should work account = await client.get_account( address=Address.from_hex("0x40a3d1b2460658b0").bytes )