You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: query_account expects a BaseAccount type. Other chains Like Bostrom appear to have a mix of types. My guess is that the account change from BaseAccount to PeriodicVestingAccount happens after a "investmint" event is transacted.
if response.account.Is(BaseAccount.DESCRIPTOR):
account = BaseAccount()
response.account.Unpack(account)
elif response.account.Is(PeriodicVestingAccount.DESCRIPTOR):
account = PeriodicVestingAccount()
response.account.Unpack(account)
account = account.base_vesting_account.base_account
else:
raise RuntimeError("Unexpected account type returned from query")
Remarks: #324 and #328 report the same error message but did not make note of the account type they were using. It is uncertain if this is the cause for their issues as well.
Current Behavior
Traceback (most recent call last):
File "/workdir/csms.py", line 114, in <module>
loop.run_until_complete(main())
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/workdir/csms.py", line 62, in main
account = ledger.query_account(wallet.address())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cosmpy/aerial/client/__init__.py", line 315, in query_account
raise RuntimeError("Unexpected account type returned from query")
RuntimeError: Unexpected account type returned from query
Prerequisites
Expected Behavior
Usage:
Issue:
query_account
expects a BaseAccount type. Other chains Like Bostrom appear to have a mix of types. My guess is that the account change from BaseAccount to PeriodicVestingAccount happens after a "investmint" event is transacted.Fix:
Add PeriodicVestingAccount import to https://github.com/fetchai/cosmpy/blob/main/cosmpy/aerial/client/__init__.py
Change https://github.com/fetchai/cosmpy/blob/main/cosmpy/aerial/client/__init__.py#L313-L316 to
Remarks:
#324 and #328 report the same error message but did not make note of the account type they were using. It is uncertain if this is the cause for their issues as well.
Current Behavior
To Reproduce
No response
Context
Debian 12 Bookworm
Python 3.11.6
Cosmpy v0.9.1 & v0.9.2
Failure Logs
No response
The text was updated successfully, but these errors were encountered: