Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Jul 3, 2024
1 parent 2a6f434 commit e1c3d01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion safe_transaction_service/history/services/balance_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ def get_balances(
django_cache.set(cache_key_count, count, 60 * 10) # 10 minutes cache
return balances, count

def _get_erc20_limits(self, limit, offset) -> Tuple[int, int]:
def _get_erc20_list_limits(self, limit: int, offset: int) -> Tuple[int, int]:
"""
Calculates the number of elements that must be taken from ERC20 list and return the start and end limits.
:param limit:
:param offset:
:return: Tuple start, end
"""
if not limit:
# No pagination no limits
return 0, None
Expand Down Expand Up @@ -241,6 +248,7 @@ def _get_balances(

balances = []
if offset != 0 and raw_balances:
# Remove ethereum balance if is not the first page
raw_balances = raw_balances[1:]

for balance in raw_balances:
Expand Down

0 comments on commit e1c3d01

Please sign in to comment.