Skip to content

Commit

Permalink
test feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin-Ray committed Oct 3, 2024
1 parent 4b28b96 commit f7c5f97
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
3 changes: 2 additions & 1 deletion crates/proof-of-sql/benches/bench_append_rows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//! cargo bench --features "test" --bench bench_append_rows
//! ```
#![allow(missing_docs, clippy::missing_docs_in_private_items)]
use ark_std::test_rng;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use proof_of_sql::{
base::{
Expand All @@ -20,7 +21,7 @@ use proof_of_sql::{
scalar::Scalar,
},
proof_primitive::dory::{
test_rng, DoryCommitment, DoryProverPublicSetup, DoryScalar, ProverSetup, PublicParameters,
DoryCommitment, DoryProverPublicSetup, DoryScalar, ProverSetup, PublicParameters,
},
};
use proof_of_sql_parser::posql_time::{PoSQLTimeUnit, PoSQLTimeZone};
Expand Down
7 changes: 3 additions & 4 deletions crates/proof-of-sql/benches/jaeger_benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//! ```
//! Then, navigate to http://localhost:16686 to view the traces.

#[cfg(feature = "test")]
use ark_std::test_rng;
use blitzar::{compute::init_backend, proof::InnerProductProof};
#[cfg(feature = "test")]
use proof_of_sql::proof_primitive::dory::{
Expand Down Expand Up @@ -53,10 +55,7 @@ fn main() {
#[cfg(feature = "test")]
"Dory" => {
// Run 3 times to ensure that warm-up of the GPU has occurred.
let pp = PublicParameters::test_rand(
10,
&mut proof_of_sql::proof_primitive::dory::test_rng(),
);
let pp = PublicParameters::test_rand(10, &mut test_rng());
let ps = ProverSetup::from(&pp);
let prover_setup = DoryProverPublicSetup::new(&ps, 10);
let vs = VerifierSetup::from(&pp);
Expand Down
2 changes: 1 addition & 1 deletion crates/proof-of-sql/src/proof_primitive/dory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod rand_util;
use rand_util::rand_F_tensors;
#[cfg(test)]
use rand_util::rand_G_vecs;
#[cfg(any(test, feature = "test"))]
#[cfg(test)]
pub use rand_util::test_rng;

mod dory_messages;
Expand Down
12 changes: 7 additions & 5 deletions crates/proof-of-sql/src/proof_primitive/dory/rand_util.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#[cfg(test)]
use super::F;
use super::{G1Affine, G2Affine};
use super::{G1Affine, G2Affine, F};
#[cfg(test)]
use ark_std::rand::{rngs::StdRng, SeedableRng};
use ark_std::{rand::Rng, UniformRand};
use ark_std::{
rand::{rngs::StdRng, Rng, SeedableRng},
UniformRand,
};

#[cfg(test)]
/// Create a random number generator for testing.
pub fn test_rng() -> impl Rng {
ark_std::test_rng()
Expand All @@ -16,7 +18,7 @@ pub fn test_seed_rng(seed: [u8; 32]) -> impl Rng {
StdRng::from_seed(seed)
}

#[allow(dead_code)]
#[cfg(test)]
/// Creates two vectors of random G1 and G2 elements with length 2^nu.
pub fn rand_G_vecs<R>(nu: usize, rng: &mut R) -> (Vec<G1Affine>, Vec<G2Affine>)
where
Expand Down
5 changes: 3 additions & 2 deletions crates/proof-of-sql/tests/timestamp_integration_tests.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#![cfg(feature = "test")]
use ark_std::test_rng;
#[cfg(feature = "blitzar")]
use proof_of_sql::base::commitment::InnerProductProof;
use proof_of_sql::{
base::database::{owned_table_utility::*, OwnedTableTestAccessor, TestAccessor},
proof_primitive::dory::{
test_rng, DoryCommitment, DoryEvaluationProof, DoryProverPublicSetup,
DoryVerifierPublicSetup, ProverSetup, PublicParameters, VerifierSetup,
DoryCommitment, DoryEvaluationProof, DoryProverPublicSetup, DoryVerifierPublicSetup,
ProverSetup, PublicParameters, VerifierSetup,
},
sql::{
parse::QueryExpr,
Expand Down

0 comments on commit f7c5f97

Please sign in to comment.