From 0afc7b2462f59e357375500ac5c34acd314d625e Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 12 Feb 2024 13:19:32 -0600 Subject: [PATCH] misc renames --- codex/slots/sampler/sampler.nim | 4 ++-- codex/slots/types.nim | 2 +- codex/utils/poseidon2digest.nim | 4 ---- tests/codex/slots/backends/testcircomcompat.nim | 8 ++++---- tests/codex/slots/sampler/testsampler.nim | 2 +- tests/codex/slots/sampler/testutils.nim | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/codex/slots/sampler/sampler.nim b/codex/slots/sampler/sampler.nim index e04805db..aef3545d 100644 --- a/codex/slots/sampler/sampler.nim +++ b/codex/slots/sampler/sampler.nim @@ -91,7 +91,7 @@ proc getSample*[T, H]( proc getProofInput*[T, H]( self: DataSampler[T, H], entropy: ProofChallenge, - nSamples: Natural): Future[?!ProofInput[H]] {.async.} = + nSamples: Natural): Future[?!ProofInputs[H]] {.async.} = ## Generate proofs as input to the proving circuit. ## @@ -124,7 +124,7 @@ proc getProofInput*[T, H]( (await self.getSample(cellIdx, slotTreeCid, slotRoot)).valueOr: return failure("Failed to get sample") - success ProofInput[H]( + success ProofInputs[H]( entropy: entropy, datasetRoot: datasetRoot, slotProof: slotProof.path, diff --git a/codex/slots/types.nim b/codex/slots/types.nim index de515e9c..04690adc 100644 --- a/codex/slots/types.nim +++ b/codex/slots/types.nim @@ -17,7 +17,7 @@ type datasetRoot*: H entropy*: H - ProofInput*[H] = object + ProofInputs*[H] = object entropy*: H datasetRoot*: H slotIndex*: Natural diff --git a/codex/utils/poseidon2digest.nim b/codex/utils/poseidon2digest.nim index 56f072cd..efdb3c6a 100644 --- a/codex/utils/poseidon2digest.nim +++ b/codex/utils/poseidon2digest.nim @@ -12,10 +12,6 @@ import pkg/questionable/results import pkg/libp2p/multihash import pkg/stew/byteutils -import pkg/constantine/math/arithmetic -import pkg/constantine/math/io/io_bigints -import pkg/constantine/math/io/io_fields - import ../merkletree func spongeDigest*( diff --git a/tests/codex/slots/backends/testcircomcompat.nim b/tests/codex/slots/backends/testcircomcompat.nim index e6a31c15..926c85b6 100644 --- a/tests/codex/slots/backends/testcircomcompat.nim +++ b/tests/codex/slots/backends/testcircomcompat.nim @@ -31,7 +31,7 @@ suite "Test Circom Compat Backend - control inputs": var circom: CircomCompat verifyingKeyPtr: ptr CircomKey - proofInput: ProofInput[Poseidon2Hash] + proofInput: ProofInputs[Poseidon2Hash] publicInputs: CircomInputs setup: @@ -47,7 +47,7 @@ suite "Test Circom Compat Backend - control inputs": verifyingKeyPtr = circom.getVerifyingKey().tryGet teardown: - publicInputs.releaseNimInputs() # this is allocated by nim + publicInputs.releaseCircomInputs() # this is allocated by nim verifyingKeyPtr.addr.releaseKey() # this comes from the rust FFI circom.release() # this comes from the rust FFI @@ -85,7 +85,7 @@ suite "Test Circom Compat Backend": verifiable: Manifest circom: CircomCompat verifyingKeyPtr: ptr CircomKey - proofInput: ProofInput[Poseidon2Hash] + proofInput: ProofInputs[Poseidon2Hash] publicInputs: CircomInputs challenge: array[32, byte] builder: Poseidon2Builder @@ -118,7 +118,7 @@ suite "Test Circom Compat Backend": publicInputs = proofInput.toPublicInputs.toCircomInputs teardown: - publicInputs.releaseNimInputs() # this is allocated by nim + publicInputs.releaseCircomInputs() # this is allocated by nim verifyingKeyPtr.addr.releaseKey() # this comes from the rust FFI circom.release() # this comes from the rust FFI diff --git a/tests/codex/slots/sampler/testsampler.nim b/tests/codex/slots/sampler/testsampler.nim index 3eeb2287..3b292f7e 100644 --- a/tests/codex/slots/sampler/testsampler.nim +++ b/tests/codex/slots/sampler/testsampler.nim @@ -31,7 +31,7 @@ suite "Test Sampler - control samples": var inputData: string inputJson: JsonNode - proofInput: ProofInput[Poseidon2Hash] + proofInput: ProofInputs[Poseidon2Hash] setup: inputData = readFile("tests/circuits/fixtures/input.json") diff --git a/tests/codex/slots/sampler/testutils.nim b/tests/codex/slots/sampler/testutils.nim index 2c9520d0..334abe5c 100644 --- a/tests/codex/slots/sampler/testutils.nim +++ b/tests/codex/slots/sampler/testutils.nim @@ -34,7 +34,7 @@ asyncchecksuite "Test proof sampler utils": var inputData: string inputJson: JsonNode - proofInput: ProofInput[Poseidon2Hash] + proofInput: ProofInputs[Poseidon2Hash] setup: inputData = readFile("tests/circuits/fixtures/input.json")