Avoid using pointer to task, use the actual task object. Add some checked exceptions

This commit is contained in:
Dmitriy Ryajov 2025-05-28 19:19:56 -06:00
parent 4035900797
commit 0f01c9c965
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4

View File

@ -358,7 +358,7 @@ proc asyncEncode*(
proc encodeData(
self: Erasure, manifest: Manifest, params: EncodingParams
): Future[?!Manifest] {.async.} =
): Future[?!Manifest] {.async: (raises: [CancelledError]).} =
## Encode blocks pointed to by the protected manifest
##
## `manifest` - the manifest to encode
@ -457,7 +457,7 @@ proc encode*(
blocks: Natural,
parity: Natural,
strategy = SteppedStrategy,
): Future[?!Manifest] {.async.} =
): Future[?!Manifest] {.async: (raises: [CancelledError]).} =
## Encode a manifest into one that is erasure protected.
##
## `manifest` - the original manifest to be encoded
@ -548,7 +548,9 @@ proc asyncDecode*(
success()
proc decode*(self: Erasure, encoded: Manifest): Future[?!Manifest] {.async.} =
proc decode*(
self: Erasure, encoded: Manifest
): Future[?!Manifest] {.async: (raises: [CancelledError]).} =
## Decode a protected manifest into it's original
## manifest
##