From 61eab823f45c294c6edbeff37e4662b8d9d5d769 Mon Sep 17 00:00:00 2001 From: June Date: Tue, 8 Oct 2024 23:17:01 +0800 Subject: [PATCH] refactor by adding nova_scotia_types.rs --- mopro-ffi/src/lib.rs | 16 ++-------------- mopro-ffi/src/nova_scotia/mod.rs | 8 -------- test-e2e/src/lib.rs | 2 ++ test-e2e/src/nova_scotia_types.rs | 13 +++++++++++++ 4 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 test-e2e/src/nova_scotia_types.rs diff --git a/mopro-ffi/src/lib.rs b/mopro-ffi/src/lib.rs index 13c3f95f..6fe82170 100644 --- a/mopro-ffi/src/lib.rs +++ b/mopro-ffi/src/lib.rs @@ -19,7 +19,7 @@ pub use circom::{ pub use halo2::{Halo2ProveFn, Halo2VerifyFn}; #[cfg(feature = "nova_scotia")] -pub use nova_scotia::{}; +// pub use nova_scotia::{}; #[cfg(not(feature = "circom"))] #[macro_export] @@ -77,19 +77,7 @@ macro_rules! halo2_app { #[macro_export] macro_rules! nova_scotia_app { () => { - use std::{collections::HashMap, path::PathBuf}; - use serde_json::Value; - use nova_snark::{ - traits::{circuit::TrivialTestCircuit, Group}, - provider, PublicParams, RecursiveSNARK, - }; - use nova_scotia::circom::circuit::{Constraint, R1CS, CircomCircuit}; - - pub type F = ::Scalar; - pub type P1 = provider::bn256_grumpkin::bn256::Point; - pub type P2 = provider::bn256_grumpkin::grumpkin::Point; - pub type C1 = CircomCircuit<::Scalar>; - pub type C2 = TrivialTestCircuit<::Scalar>; + pub use nova_scotia_types::*; fn generate_recursive_snark_proof( witness_generator_file: PathBuf, diff --git a/mopro-ffi/src/nova_scotia/mod.rs b/mopro-ffi/src/nova_scotia/mod.rs index 2b1de78a..3a9907a8 100644 --- a/mopro-ffi/src/nova_scotia/mod.rs +++ b/mopro-ffi/src/nova_scotia/mod.rs @@ -1,11 +1,3 @@ -// use nova_snark::{ -// traits::{circuit::TrivialTestCircuit, Group}, -// provider, PublicParams, RecursiveSNARK, -// }; -// use ff::PrimeField; -// use std::path::PathBuf; -// use std::collections::HashMap; - #[macro_export] macro_rules! nova_scotia_app { () => { diff --git a/test-e2e/src/lib.rs b/test-e2e/src/lib.rs index c1f8c0da..4b7c3578 100644 --- a/test-e2e/src/lib.rs +++ b/test-e2e/src/lib.rs @@ -1,5 +1,7 @@ extern crate core; +mod nova_scotia_types; + // First, configure the Mopro FFI library mopro_ffi::app!(); diff --git a/test-e2e/src/nova_scotia_types.rs b/test-e2e/src/nova_scotia_types.rs new file mode 100644 index 00000000..2d5275f0 --- /dev/null +++ b/test-e2e/src/nova_scotia_types.rs @@ -0,0 +1,13 @@ +pub use std::{collections::HashMap, path::PathBuf}; +pub use serde_json::Value; +pub use nova_snark::{ + traits::{circuit::TrivialTestCircuit, Group}, + provider, PublicParams, RecursiveSNARK, +}; +pub use nova_scotia::circom::circuit::{Constraint, R1CS, CircomCircuit}; + +pub type F = ::Scalar; +pub type P1 = provider::bn256_grumpkin::bn256::Point; +pub type P2 = provider::bn256_grumpkin::grumpkin::Point; +pub type C1 = CircomCircuit<::Scalar>; +pub type C2 = TrivialTestCircuit<::Scalar>; \ No newline at end of file