wire in prove
This commit is contained in:
parent
0dfa2cc488
commit
1e86b5c051
|
@ -1,4 +1,4 @@
|
||||||
import std/sequtils
|
import std/options
|
||||||
|
|
||||||
import pkg/taskpools
|
import pkg/taskpools
|
||||||
import pkg/taskpools/flowvars
|
import pkg/taskpools/flowvars
|
||||||
|
@ -26,14 +26,17 @@ type
|
||||||
signal: ThreadSignalPtr
|
signal: ThreadSignalPtr
|
||||||
params: CircomCompatParams
|
params: CircomCompatParams
|
||||||
|
|
||||||
var circomBackend {.threadvar.}: CircomCompat
|
var circomBackend {.threadvar.}: Option[CircomCompat]
|
||||||
|
|
||||||
proc proveTask[H](
|
proc proveTask[H](
|
||||||
args: ProveTaskArgs, data: ProofInputs[H]
|
args: ProveTaskArgs, data: ProofInputs[H]
|
||||||
): Result[CircomProof, string] =
|
): Result[CircomProof, string] =
|
||||||
|
|
||||||
try:
|
try:
|
||||||
let res = circomBackend.prove(data)
|
if circomBackend.isNone:
|
||||||
|
circomBackend = some CircomCompat.init(args.params)
|
||||||
|
|
||||||
|
let res = circomBackend.get().prove(data)
|
||||||
if res.isOk:
|
if res.isOk:
|
||||||
return ok(res.get())
|
return ok(res.get())
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -99,7 +99,6 @@ proc new*(
|
||||||
backend: AnyBackend,
|
backend: AnyBackend,
|
||||||
nSamples: int
|
nSamples: int
|
||||||
): Prover =
|
): Prover =
|
||||||
|
|
||||||
Prover(
|
Prover(
|
||||||
backend: backend,
|
backend: backend,
|
||||||
store: store,
|
store: store,
|
||||||
|
|
Loading…
Reference in New Issue