diff --git a/src/database/mod.rs b/src/database/mod.rs index c3c2db7e..2e77d30e 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -1128,7 +1128,10 @@ mod test { let mock_provers = mock_provers(); db.insert_provers(mock_provers.clone()).await?; + db.remove_prover(100, ProverType::Insertion).await?; + db.remove_prover(100, ProverType::Deletion).await?; + let provers = db.get_provers().await?; assert_eq!(provers, HashSet::new()); diff --git a/src/prover/mod.rs b/src/prover/mod.rs index b6ee87ac..d178fe0d 100644 --- a/src/prover/mod.rs +++ b/src/prover/mod.rs @@ -86,7 +86,7 @@ pub struct ProverConfiguration { pub prover_type: ProverType, } -#[derive(Debug, Copy, Clone, sqlx::Type, PartialEq, Eq, Serialize, Deserialize, Default)] +#[derive(Debug, Copy, Clone, sqlx::Type, PartialEq, Eq, Hash, Serialize, Deserialize, Default)] #[serde(rename_all = "camelCase")] #[sqlx(type_name = "prover_enum", rename_all = "PascalCase")] pub enum ProverType { @@ -98,12 +98,13 @@ pub enum ProverType { impl Hash for ProverConfiguration { fn hash(&self, state: &mut H) { self.batch_size.hash(state); + self.prover_type.hash(state); } } impl PartialEq for ProverConfiguration { fn eq(&self, other: &Self) -> bool { - self.batch_size == other.batch_size + self.batch_size.eq(&other.batch_size) && self.prover_type.eq(&other.prover_type) } }