Skip to content

Commit

Permalink
don't do an extra call
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienGasser authored and Kelvin-M committed Dec 7, 2020
1 parent 57f0c41 commit 8543e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/substrapp/ledger/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def call_ledger(channel_name, call_type, fcn, *args, **kwargs):

if isinstance(response, dict) and 'bookmarks' in response:
results = response['results'] # first results
while response['results']:
kwargs['args'] = {'bookmarks': response['bookmarks']}
while response['results'] and len(response['bookmark']) > 0:
kwargs['args'] = {'bookmark': response['bookmark']}
response = _call_ledger(channel_name, call_type, fcn, *args, **kwargs)
results.extend(response['results']) # following results
else:
Expand Down

0 comments on commit 8543e47

Please sign in to comment.