Skip to content

Commit

Permalink
Fix invalid deduplication logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop committed Jan 11, 2024
1 parent 5d4bda7 commit b6e66b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -97,13 +97,17 @@ pub enum ProverType {

impl Hash for ProverConfiguration {
fn hash<H: Hasher>(&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)
}
}

Expand Down

0 comments on commit b6e66b8

Please sign in to comment.