Skip to content

Commit

Permalink
RewardsSugar: lower epochsLatest() page size.
Browse files Browse the repository at this point in the history
  • Loading branch information
stas committed Nov 2, 2024
1 parent d7a87d9 commit 07d3fce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/RewardsSugar.vy
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def __init__(_voter: address, _registry: address, _convertor: address):
@external
@view
def epochsLatest(_limit: uint256, _offset: uint256) \
-> DynArray[LpEpoch, lp_shared.MAX_POOLS]:
-> DynArray[LpEpoch, MAX_EPOCHS]:
"""
@notice Returns all pools latest epoch data (up to 200 items)
@notice Returns all pools latest epoch data
@param _limit The max amount of pools to check for epochs
@param _offset The amount of pools to skip
@return Array for LpEpoch structs
Expand All @@ -71,7 +71,7 @@ def epochsLatest(_limit: uint256, _offset: uint256) \
pools_count: uint256 = len(pools)
counted: uint256 = 0

col: DynArray[LpEpoch, lp_shared.MAX_POOLS] = empty(DynArray[LpEpoch, lp_shared.MAX_POOLS])
col: DynArray[LpEpoch, MAX_EPOCHS] = empty(DynArray[LpEpoch, MAX_EPOCHS])

for index: uint256 in range(0, lp_shared.MAX_ITERATIONS):
if counted == _limit or index >= pools_count:
Expand Down

0 comments on commit 07d3fce

Please sign in to comment.