misc renames

This commit is contained in:
Dmitriy Ryajov 2024-02-12 13:19:32 -06:00 committed by Eric
parent e21da286d9
commit 0afc7b2462
No known key found for this signature in database
6 changed files with 9 additions and 13 deletions

View File

@ -91,7 +91,7 @@ proc getSample*[T, H](
proc getProofInput*[T, H]( proc getProofInput*[T, H](
self: DataSampler[T, H], self: DataSampler[T, H],
entropy: ProofChallenge, entropy: ProofChallenge,
nSamples: Natural): Future[?!ProofInput[H]] {.async.} = nSamples: Natural): Future[?!ProofInputs[H]] {.async.} =
## Generate proofs as input to the proving circuit. ## Generate proofs as input to the proving circuit.
## ##
@ -124,7 +124,7 @@ proc getProofInput*[T, H](
(await self.getSample(cellIdx, slotTreeCid, slotRoot)).valueOr: (await self.getSample(cellIdx, slotTreeCid, slotRoot)).valueOr:
return failure("Failed to get sample") return failure("Failed to get sample")
success ProofInput[H]( success ProofInputs[H](
entropy: entropy, entropy: entropy,
datasetRoot: datasetRoot, datasetRoot: datasetRoot,
slotProof: slotProof.path, slotProof: slotProof.path,

View File

@ -17,7 +17,7 @@ type
datasetRoot*: H datasetRoot*: H
entropy*: H entropy*: H
ProofInput*[H] = object ProofInputs*[H] = object
entropy*: H entropy*: H
datasetRoot*: H datasetRoot*: H
slotIndex*: Natural slotIndex*: Natural

View File

@ -12,10 +12,6 @@ import pkg/questionable/results
import pkg/libp2p/multihash import pkg/libp2p/multihash
import pkg/stew/byteutils 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 import ../merkletree
func spongeDigest*( func spongeDigest*(

View File

@ -31,7 +31,7 @@ suite "Test Circom Compat Backend - control inputs":
var var
circom: CircomCompat circom: CircomCompat
verifyingKeyPtr: ptr CircomKey verifyingKeyPtr: ptr CircomKey
proofInput: ProofInput[Poseidon2Hash] proofInput: ProofInputs[Poseidon2Hash]
publicInputs: CircomInputs publicInputs: CircomInputs
setup: setup:
@ -47,7 +47,7 @@ suite "Test Circom Compat Backend - control inputs":
verifyingKeyPtr = circom.getVerifyingKey().tryGet verifyingKeyPtr = circom.getVerifyingKey().tryGet
teardown: teardown:
publicInputs.releaseNimInputs() # this is allocated by nim publicInputs.releaseCircomInputs() # this is allocated by nim
verifyingKeyPtr.addr.releaseKey() # this comes from the rust FFI verifyingKeyPtr.addr.releaseKey() # this comes from the rust FFI
circom.release() # 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 verifiable: Manifest
circom: CircomCompat circom: CircomCompat
verifyingKeyPtr: ptr CircomKey verifyingKeyPtr: ptr CircomKey
proofInput: ProofInput[Poseidon2Hash] proofInput: ProofInputs[Poseidon2Hash]
publicInputs: CircomInputs publicInputs: CircomInputs
challenge: array[32, byte] challenge: array[32, byte]
builder: Poseidon2Builder builder: Poseidon2Builder
@ -118,7 +118,7 @@ suite "Test Circom Compat Backend":
publicInputs = proofInput.toPublicInputs.toCircomInputs publicInputs = proofInput.toPublicInputs.toCircomInputs
teardown: teardown:
publicInputs.releaseNimInputs() # this is allocated by nim publicInputs.releaseCircomInputs() # this is allocated by nim
verifyingKeyPtr.addr.releaseKey() # this comes from the rust FFI verifyingKeyPtr.addr.releaseKey() # this comes from the rust FFI
circom.release() # this comes from the rust FFI circom.release() # this comes from the rust FFI

View File

@ -31,7 +31,7 @@ suite "Test Sampler - control samples":
var var
inputData: string inputData: string
inputJson: JsonNode inputJson: JsonNode
proofInput: ProofInput[Poseidon2Hash] proofInput: ProofInputs[Poseidon2Hash]
setup: setup:
inputData = readFile("tests/circuits/fixtures/input.json") inputData = readFile("tests/circuits/fixtures/input.json")

View File

@ -34,7 +34,7 @@ asyncchecksuite "Test proof sampler utils":
var var
inputData: string inputData: string
inputJson: JsonNode inputJson: JsonNode
proofInput: ProofInput[Poseidon2Hash] proofInput: ProofInputs[Poseidon2Hash]
setup: setup:
inputData = readFile("tests/circuits/fixtures/input.json") inputData = readFile("tests/circuits/fixtures/input.json")