Skip to content

Commit 5b2ba98

Browse files
authored
Fix: possible off-by-1 error (#157)
When the big maps are all in the same level, using `i + 1` at the end when passing the tuple is missing the last member because i stops at `len - 1`. A 16 length big map event was returning 0 - 14 instead of 0 - 15. I just added 1 in the final case and it fixed the issue on my end. I'm not sure if there are any side-effects here.
1 parent 285c8d6 commit 5b2ba98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dipdup/datasources/tzkt/datasource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ async def fetch_big_maps_by_level(self) -> AsyncGenerator[Tuple[int, Tuple[BigMa
240240
offset += self._datasource.request_limit
241241

242242
if big_maps:
243-
yield big_maps[0].level, tuple(big_maps[: i + 1])
243+
yield big_maps[0].level, tuple(big_maps[: i + 2])
244244

245245

246246
class TzktDatasource(IndexDatasource):

0 commit comments

Comments
 (0)