mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-03-17 09:43:20 +00:00
Avoid using pointer to task, use the actual task object. Add some checked exceptions
This commit is contained in:
parent
76e92cb501
commit
9b02432702
@ -362,7 +362,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
|
||||
@ -461,7 +461,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
|
||||
@ -554,7 +554,7 @@ proc asyncDecode*(
|
||||
|
||||
proc decodeInternal(
|
||||
self: Erasure, encoded: Manifest
|
||||
): Future[?!(ref seq[Cid], seq[Natural])] {.async.} =
|
||||
): Future[?!(ref seq[Cid], seq[Natural])] {.async: (raises:[CancelledError]).} =
|
||||
logScope:
|
||||
steps = encoded.steps
|
||||
rounded_blocks = encoded.rounded
|
||||
@ -638,7 +638,9 @@ proc decodeInternal(
|
||||
|
||||
return (cids, recoveredIndices).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
|
||||
##
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user