From 8943a03747abcabe03b035070ccaa76da8c639b1 Mon Sep 17 00:00:00 2001 From: Jay White Date: Mon, 21 Oct 2024 10:48:51 -0400 Subject: [PATCH] feat: expose `OwnedTableTestAccessor` without `test` feature --- crates/proof-of-sql/src/base/database/mod.rs | 4 ---- .../src/base/database/owned_table_test_accessor.rs | 3 ++- crates/proof-of-sql/src/base/database/test_accessor.rs | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/proof-of-sql/src/base/database/mod.rs b/crates/proof-of-sql/src/base/database/mod.rs index a1bb6dd7f..f3360cc5f 100644 --- a/crates/proof-of-sql/src/base/database/mod.rs +++ b/crates/proof-of-sql/src/base/database/mod.rs @@ -67,9 +67,7 @@ pub use owned_and_arrow_conversions::OwnedArrowConversionError; #[cfg(all(test, feature = "arrow"))] mod owned_and_arrow_conversions_test; -#[cfg(any(test, feature = "test"))] mod test_accessor; -#[cfg(any(test, feature = "test"))] pub use test_accessor::TestAccessor; #[cfg(test)] pub(crate) use test_accessor::UnimplementedTestAccessor; @@ -79,9 +77,7 @@ mod test_schema_accessor; #[cfg(test)] pub(crate) use test_schema_accessor::TestSchemaAccessor; -#[cfg(any(test, feature = "test"))] mod owned_table_test_accessor; -#[cfg(any(test, feature = "test"))] pub use owned_table_test_accessor::OwnedTableTestAccessor; #[cfg(all(test, feature = "blitzar"))] mod owned_table_test_accessor_test; diff --git a/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs b/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs index ceb5b7045..3217ee9dd 100644 --- a/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs +++ b/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs @@ -6,11 +6,12 @@ use crate::base::{ commitment::{CommitmentEvaluationProof, VecCommitmentExt}, map::IndexMap, }; +use alloc::{string::String, vec::Vec}; use bumpalo::Bump; use proof_of_sql_parser::Identifier; /// A test accessor that uses [`OwnedTable`] as the underlying table type. -/// Note: this is not optimized for performance, so should not be used for benchmarks. +/// Note: this is intended for testing and examples. It is not optimized for performance, so should not be used for benchmarks or production use-cases. pub struct OwnedTableTestAccessor<'a, CP: CommitmentEvaluationProof> { tables: IndexMap, usize)>, alloc: Bump, diff --git a/crates/proof-of-sql/src/base/database/test_accessor.rs b/crates/proof-of-sql/src/base/database/test_accessor.rs index cd9da1d65..177e27cbb 100644 --- a/crates/proof-of-sql/src/base/database/test_accessor.rs +++ b/crates/proof-of-sql/src/base/database/test_accessor.rs @@ -3,10 +3,11 @@ use super::{ SchemaAccessor, TableRef, }; use crate::base::{commitment::Commitment, scalar::Curve25519Scalar}; +use alloc::vec::Vec; use curve25519_dalek::ristretto::RistrettoPoint; use proof_of_sql_parser::Identifier; -/// A trait that defines the interface for a combined metadata, schema, commitment, and data accessor for unit testing purposes. +/// A trait that defines the interface for a combined metadata, schema, commitment, and data accessor for unit testing or example purposes. pub trait TestAccessor: Clone + Default