Skip to content

Commit

Permalink
Merge pull request #970 from input-output-hk/jpraynaud/953-fix-clean-…
Browse files Browse the repository at this point in the history
…epoch-certifier-service

Fix clean epoch Certifier service
  • Loading branch information
jpraynaud authored Jun 8, 2023
2 parents 9b4a794 + 8a792cc commit 3d6a1d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.3.26"
version = "0.3.27"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions mithril-aggregator/src/database/provider/open_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl<'client> DeleteOpenMessageProvider<'client> {

fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
WhereCondition::new(
"epoch_setting_id <= ?*",
"epoch_setting_id < ?*",
vec![Value::Integer(epoch.0 as i64)],
)
}
Expand Down Expand Up @@ -547,7 +547,7 @@ impl OpenMessageRepository {
.ok_or_else(|| panic!("Updating an open_message should not return nothing."))
}

/// Remove all the [OpenMessageRecord] for the given Epoch in the database.
/// Remove all the [OpenMessageRecord] for the strictly previous epochs of the given epoch in the database.
/// It returns the number of messages removed.
pub async fn clean_epoch(&self, epoch: Epoch) -> StdResult<usize> {
let lock = self.connection.lock().await;
Expand Down Expand Up @@ -712,7 +712,7 @@ mod tests {
let provider = DeleteOpenMessageProvider::new(&connection);
let (expr, params) = provider.get_epoch_condition(Epoch(12)).expand();

assert_eq!("epoch_setting_id <= ?1".to_string(), expr);
assert_eq!("epoch_setting_id < ?1".to_string(), expr);
assert_eq!(vec![Value::Integer(12)], params,);
}

Expand Down

0 comments on commit 3d6a1d5

Please sign in to comment.