work around windows - no without

This commit is contained in:
Jaremy Creechley 2024-05-20 21:15:34 +03:00
parent 26809823ed
commit 9dcf56b5f5
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 8 additions and 6 deletions

View File

@ -30,9 +30,10 @@ proc prove*[H](
self: AsyncCircomCompat, input: ProofInputs[H]
): Future[?!CircomProof] {.async.} =
## Generates proof using circom-compat asynchronously
##
without queue =? newSignalQueue[?!CircomProof](maxItems = 1), err:
return (?!CircomProof).err(err)
let queueRes = newSignalQueue[?!CircomProof](maxItems = 1)
if queueRes.isErr:
return failure queueRes.error()
let queue = queueRes.get()
proc spawnTask() =
self.tp.spawn proveTask(self.circom, input, queue)
@ -83,7 +84,9 @@ proc verify*[H](
success(verified)
proc init*(_: type AsyncCircomCompat, params: CircomCompatParams, tp: Taskpool): AsyncCircomCompat =
proc init*(
_: type AsyncCircomCompat, params: CircomCompatParams, tp: Taskpool
): AsyncCircomCompat =
## Create a new async circom
##
let circom = CircomCompat.init(params)

View File

@ -35,8 +35,7 @@ proc newSignalQueue*[T](
let queue = cast[ptr SignalQueue[T]](allocShared0(sizeof(SignalQueue[T])))
let sigRes = ThreadSignalPtr.new()
if sigRes.isErr():
let msg: string = sigRes.error()
return failure((ref CatchableError)(msg: msg))
return failure((ref CatchableError)(msg: sigRes.error()))
else:
queue[].signal = sigRes.get()
queue[].chan.open(maxItems)