fix results stuff
This commit is contained in:
parent
96862372e5
commit
ebc284ae6a
|
@ -56,8 +56,20 @@ proc prove*[H](
|
||||||
let args = ProveTaskArgs(signal: signal, params: self.params)
|
let args = ProveTaskArgs(signal: signal, params: self.params)
|
||||||
let flowvar = self.tp.spawn proveTask(args, input)
|
let flowvar = self.tp.spawn proveTask(args, input)
|
||||||
|
|
||||||
without res =? await awaitThreadResult(signal, flowvar), err:
|
without taskRes =? await awaitThreadResult(signal, flowvar), err:
|
||||||
return failure(err)
|
let res: ?!CircomProof = failure(err)
|
||||||
|
return res
|
||||||
|
|
||||||
|
without proof =? taskRes.mapFailure, err:
|
||||||
|
let res: ?!CircomProof = failure(err)
|
||||||
|
return res
|
||||||
|
|
||||||
|
let sigRes = signal.close()
|
||||||
|
if sigRes.isErr:
|
||||||
|
return failure(sigRes.error())
|
||||||
|
|
||||||
|
let pf: CircomProof = proof
|
||||||
|
success(pf)
|
||||||
|
|
||||||
proc verify*[H](
|
proc verify*[H](
|
||||||
self: AsyncCircomCompat, proof: CircomProof, inputs: ProofInputs[H]
|
self: AsyncCircomCompat, proof: CircomProof, inputs: ProofInputs[H]
|
||||||
|
|
|
@ -15,6 +15,7 @@ proc awaitThreadResult*[T](signal: ThreadSignalPtr, handle: Flowvar[T]): Future[
|
||||||
var
|
var
|
||||||
res: T
|
res: T
|
||||||
awaitTotal: Duration
|
awaitTotal: Duration
|
||||||
|
|
||||||
while awaitTotal < CompletionTimeout:
|
while awaitTotal < CompletionTimeout:
|
||||||
if handle.tryComplete(res):
|
if handle.tryComplete(res):
|
||||||
return success(res)
|
return success(res)
|
||||||
|
|
Loading…
Reference in New Issue