From b6e66b8440956cb85d753887ae08be9837557ce5 Mon Sep 17 00:00:00 2001 From: Dzejkop Date: Thu, 11 Jan 2024 16:16:50 +0100 Subject: [PATCH] Fix invalid deduplication logic --- src/prover/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/prover/mod.rs b/src/prover/mod.rs index b6ee87ac..6ad97962 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 { @@ -97,13 +97,17 @@ pub enum ProverType { impl Hash for ProverConfiguration { fn hash(&self, state: &mut H) { + self.url.hash(state); 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.url.eq(&other.url) + && self.batch_size.eq(&other.batch_size) + && self.prover_type.eq(&other.prover_type) } }