From 8effaf76e9e6fe1e3e77a34367d2775c9171d729 Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Sat, 14 Aug 2021 08:48:02 -0700 Subject: [PATCH] eval_fns for PublicInputGate (#177) And a small fix in eval_fns --- src/gates/gate_testing.rs | 4 +--- src/gates/noop.rs | 1 - src/gates/public_input.rs | 7 ++++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gates/gate_testing.rs b/src/gates/gate_testing.rs index 66bed775..4d336454 100644 --- a/src/gates/gate_testing.rs +++ b/src/gates/gate_testing.rs @@ -137,9 +137,7 @@ pub(crate) fn test_eval_fns, G: Gate, const D: usize>( let vars = EvaluationVars { local_constants: &constants, local_wires: &wires, - public_inputs_hash: &HashOut { - elements: [F::ZERO; 4], - }, + public_inputs_hash: &public_inputs_hash, }; let evals = gate.eval_unfiltered(vars); diff --git a/src/gates/noop.rs b/src/gates/noop.rs index d9a3953e..69c5c1f9 100644 --- a/src/gates/noop.rs +++ b/src/gates/noop.rs @@ -56,7 +56,6 @@ impl, const D: usize> Gate for NoopGate { #[cfg(test)] mod tests { - use crate::field::crandall_field::CrandallField; use crate::gates::gate_testing::{test_eval_fns, test_low_degree}; use crate::gates::noop::NoopGate; diff --git a/src/gates/public_input.rs b/src/gates/public_input.rs index 3d3626e6..a3f05738 100644 --- a/src/gates/public_input.rs +++ b/src/gates/public_input.rs @@ -77,11 +77,16 @@ impl, const D: usize> Gate for PublicInputGate { #[cfg(test)] mod tests { use crate::field::crandall_field::CrandallField; - use crate::gates::gate_testing::test_low_degree; + use crate::gates::gate_testing::{test_eval_fns, test_low_degree}; use crate::gates::public_input::PublicInputGate; #[test] fn low_degree() { test_low_degree::(PublicInputGate) } + + #[test] + fn eval_fns() -> anyhow::Result<()> { + test_eval_fns::(PublicInputGate) + } }