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
blockchain.get_all_accounts(limit=2000, steps=1000) returns 2000 account names while internally doing two batch calls of 1000 accounts each. This should work on both appbase and non-appbase nodes
Actual behavior
blockchain.get_all_accounts(limit=2000, steps=1000) fails on appbase nodes when limit > steps
How to reproduce
>>> from beem import Steem
>>> from beem.blockchain import Blockchain
>>> s = Steem(node='https://api.steemit.com')
>>> s.rpc.get_use_appbase()
True
>>> len(list(b.get_all_accounts(limit=1000, steps=1000)))
1000
>>> len(list(b.get_all_accounts(limit=2000, steps=1000)))
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/beemapi/steemnoderpc.py", line 65, in rpcexec
reply = super(SteemNodeRPC, self).rpcexec(payload)
File "/usr/local/lib/python3.6/site-packages/beemapi/graphenerpc.py", line 381, in rpcexec
raise RPCError(ret['error']['message'])
beemapi.exceptions.RPCError: Bad Cast:Invalid cast from object_type to string
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/beem/blockchain.py", line 562, in get_all_accounts
ret = self.steem.rpc.list_accounts({'start': lastname, 'limit': steps, 'order': 'by_name'}, api="database")["accounts"]
File "/usr/local/lib/python3.6/site-packages/beemapi/graphenerpc.py", line 430, in method
r = self.rpcexec(query)
File "/usr/local/lib/python3.6/site-packages/beemapi/steemnoderpc.py", line 87, in rpcexec
doRetry = self._check_error_message(e, self.error_cnt_call)
File "/usr/local/lib/python3.6/site-packages/beemapi/steemnoderpc.py", line 146, in _check_error_message
raise exceptions.UnhandledRPCError(msg)
beemapi.exceptions.UnhandledRPCError: Bad Cast:Invalid cast from object_type to string
It works on non-appbase nodes:
>>> s = Steem("wss://steemd.pevo.science")
>>> s.rpc.get_use_appbase()
False
>>> b = Blockchain(steem_instance=s)
>>> len(list(b.get_all_accounts(limit=2000, steps=1000)))
2000
Expected behavior
blockchain.get_all_accounts(limit=2000, steps=1000)
returns 2000 account names while internally doing two batch calls of 1000 accounts each. This should work on both appbase and non-appbase nodesActual behavior
blockchain.get_all_accounts(limit=2000, steps=1000)
fails on appbase nodes whenlimit
>steps
How to reproduce
It works on non-appbase nodes:
Environment
The text was updated successfully, but these errors were encountered: