Restores testcircomcompat and testsampler.
This commit is contained in:
parent
33a37c6d4b
commit
00fe07a608
|
@ -121,7 +121,6 @@ func reconstructRoot*[H, K](proof: MerkleProof[H, K], leaf: H): ?!H =
|
|||
func verify*[H, K](proof: MerkleProof[H, K], leaf: H, root: H): ?!bool =
|
||||
success bool(root == ? proof.reconstructRoot(leaf))
|
||||
|
||||
# TODO: replace with implementation in poseidon library plz
|
||||
proc merkleTreeWorker*[H, K](
|
||||
self: MerkleTree[H, K],
|
||||
xs: seq[H],
|
||||
|
|
|
@ -66,6 +66,10 @@ proc prove*(
|
|||
error "Unable to create slots builder", err = err.msg
|
||||
return failure(err)
|
||||
|
||||
if err =? (await builder.init()).errorOption:
|
||||
error "Failed to initialize builder", err = err.msg
|
||||
return failure(err)
|
||||
|
||||
without sampler =? AnySampler.new(slotIdx, self.store, builder), err:
|
||||
error "Unable to create data sampler", err = err.msg
|
||||
return failure(err)
|
||||
|
|
|
@ -55,7 +55,7 @@ proc digestTree*(
|
|||
return failure err
|
||||
leaves.add(digest)
|
||||
index += chunkSize
|
||||
await sleepAsync(1.micros) # cooperative scheduling
|
||||
await sleepAsync(1.nanos) # cooperative scheduling
|
||||
return await Poseidon2Tree.init(leaves)
|
||||
|
||||
proc digest*(
|
||||
|
|
|
@ -99,6 +99,7 @@ suite "Test Circom Compat Backend":
|
|||
cellSize)
|
||||
|
||||
builder = Poseidon2Builder.new(store, verifiable).tryGet
|
||||
(await builder.init()).tryGet()
|
||||
sampler = Poseidon2Sampler.new(slotId, store, builder).tryGet
|
||||
|
||||
circom = CircomCompat.init(r1cs, wasm, zkey)
|
||||
|
|
|
@ -111,6 +111,7 @@ suite "Test Sampler":
|
|||
|
||||
# create sampler
|
||||
builder = Poseidon2Builder.new(store, verifiable).tryGet
|
||||
(await builder.init()).tryGet()
|
||||
|
||||
teardown:
|
||||
await store.close()
|
||||
|
|
Loading…
Reference in New Issue