Skip to content

Commit

Permalink
Simplify mock prover factory (#2305)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schaeff authored Jan 3, 2025
1 parent 4bb99be commit 5ceeda4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub const DEFAULT_ESTARK_OPTIONS: &str = "stark_gl";
impl BackendType {
pub fn factory<T: FieldElement>(&self) -> Box<dyn BackendFactory<T>> {
match self {
BackendType::Mock => Box::new(mock::MockBackendFactory::new()),
BackendType::Mock => Box::new(mock::MockBackendFactory),
#[cfg(feature = "halo2")]
BackendType::Halo2 => Box::new(halo2::Halo2ProverFactory),
#[cfg(feature = "halo2")]
Expand Down
15 changes: 2 additions & 13 deletions backend/src/mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{
collections::BTreeMap,
hash::{DefaultHasher, Hash, Hasher},
io,
marker::PhantomData,
path::PathBuf,
sync::Arc,
};
Expand All @@ -24,19 +23,9 @@ mod connection_constraint_checker;
mod machine;
mod polynomial_constraint_checker;

pub(crate) struct MockBackendFactory<F: FieldElement> {
_marker: PhantomData<F>,
}

impl<F: FieldElement> MockBackendFactory<F> {
pub(crate) const fn new() -> Self {
Self {
_marker: PhantomData,
}
}
}
pub(crate) struct MockBackendFactory;

impl<F: FieldElement> BackendFactory<F> for MockBackendFactory<F> {
impl<F: FieldElement> BackendFactory<F> for MockBackendFactory {
fn create(
&self,
pil: Arc<Analyzed<F>>,
Expand Down

0 comments on commit 5ceeda4

Please sign in to comment.