Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error calling get_account #39

Closed
timnugent opened this issue Feb 1, 2022 · 1 comment · Fixed by #55
Closed

Error calling get_account #39

timnugent opened this issue Feb 1, 2022 · 1 comment · Fixed by #55

Comments

@timnugent
Copy link

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/[email protected]/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
Copy link

heyfez commented Mar 18, 2022

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

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

Successfully merging a pull request may close this issue.

2 participants