From de140b7333ce1afc49fdd04c2e336dc07fd60eab Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 29 Jan 2024 14:59:59 -0600 Subject: [PATCH] init prover --- tests/codex/node/helpers.nim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/codex/node/helpers.nim b/tests/codex/node/helpers.nim index a9a3ea76..8cfede6c 100644 --- a/tests/codex/node/helpers.nim +++ b/tests/codex/node/helpers.nim @@ -4,6 +4,7 @@ import std/times import pkg/libp2p import pkg/chronos +import pkg/codex/slots import pkg/codex/codextypes import pkg/codex/chunker @@ -50,6 +51,8 @@ proc pipeChunker*(stream: BufferStream, chunker: Chunker) {.async.} = template setupAndTearDown*() {.dirty.} = var file: File + r1cs: string + wasm: string chunker: Chunker switch: Switch wallet: WalletRef @@ -66,12 +69,16 @@ template setupAndTearDown*() {.dirty.} = pendingBlocks: PendingBlocksManager discovery: DiscoveryEngine erasure: Erasure + circomBackend: CircomCompat + prover: Prover let path = currentSourcePath().parentDir setup: file = open(path /../ "" /../ "fixtures" / "test.jpg") + r1cs = path /../ "" /../ "circuits" / "fixtures" / "proofs_main.r1cs" + wasm = path /../ "" /../ "circuits" / "fixtures" / "proofs_main.r1cs" chunker = FileChunker.new(file = file, chunkSize = DefaultBlockSize) switch = newStandardSwitch() wallet = WalletRef.new(EthPrivateKey.random()) @@ -93,7 +100,9 @@ template setupAndTearDown*() {.dirty.} = engine = BlockExcEngine.new(localStore, wallet, network, discovery, peerStore, pendingBlocks) store = NetworkStore.new(engine, localStore) erasure = Erasure.new(store, leoEncoderProvider, leoDecoderProvider) - node = CodexNodeRef.new(switch, store, engine, erasure, blockDiscovery) + circomBackend = CircomCompat.init(r1cs, wasm) + prover = Prover.new(store, circomBackend) + node = CodexNodeRef.new(switch, store, engine, erasure, prover.some, blockDiscovery) await node.start()