updates erasure.nim after rebasing to use SafeAsyncIter and checked exceptions

This commit is contained in:
Marcin Czenko 2025-06-17 03:24:01 +02:00
parent 88c6a7291d
commit ba04d59192
No known key found for this signature in database
GPG Key ID: 33DEA0C8E30937C0

View File

@ -125,14 +125,14 @@ proc getPendingBlocks(
## Get pending blocks iterator
##
if indicies.len == 0:
if indices.len == 0:
trace "No indicies to fetch blocks for", treeCid = manifest.treeCid
return SafeAsyncIter[(?!bt.Block, int)].empty()
var pendingBlocks: seq[Future[(?!bt.Block, int)]] = @[]
var pendingBlocks: seq[Future[(?!bt.Block, int)].Raising([CancelledError])] = @[]
proc attachIndex(
fut: Future[?!bt.Block], i: int
fut: Future[?!bt.Block].Raising([CancelledError]), i: int
): Future[(?!bt.Block, int)] {.async: (raises: [CancelledError]).} =
## avoids closure capture issues
return (await fut, i)
@ -162,7 +162,7 @@ proc getPendingBlocks(
# but we check for that at the very beginning -
# thus, if this happens, we raise an assert
raiseAssert("fatal: pendingBlocks is empty - this should never happen")
SafeAsyncIter[(?!bt.Block, int)].new(genNext, isFinished)
proc prepareEncodingData(