wire in prove

This commit is contained in:
Jaremy Creechley 2024-05-17 00:59:00 +03:00
parent 0dfa2cc488
commit 1e86b5c051
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 6 additions and 4 deletions

View File

@ -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:

View File

@ -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,