From f37d851406cce55cbf903511633e892e11afbc01 Mon Sep 17 00:00:00 2001 From: swrup Date: Thu, 26 Feb 2026 17:14:31 +0100 Subject: [PATCH] --- src/http_info.ml | 4 ++-- src/http_management.ml | 4 ++-- src/time.ml | 1 + src/time.mli | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/http_info.ml b/src/http_info.ml index af03b278..a8793388 100644 --- a/src/http_info.ml +++ b/src/http_info.ml @@ -68,7 +68,7 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date = | Some timestamp -> List.find_map (fun v -> - if Timestamp.compare v.Denomination.stamp_start timestamp = 0 then + if Timestamp.equal v.Denomination.stamp_start timestamp then Some v.stamp_start else None) denom_l @@ -77,7 +77,7 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date = | None -> denom_l | Some timestamp -> List.filter - (fun v -> Timestamp.compare v.Denomination.stamp_start timestamp >= 0) + (fun v -> Timestamp.geq v.Denomination.stamp_start timestamp) denom_l in let* denominations = Denomination.make_denom_group_sorted denom_l in diff --git a/src/http_management.ml b/src/http_management.ml index 47b4a139..1203dce0 100644 --- a/src/http_management.ml +++ b/src/http_management.ml @@ -164,7 +164,7 @@ module Auditors = struct Logs.info (fun m -> m "enabled auditor"); () | Some auditor -> - if Timestamp.compare auditor.last_change validity_start > 0 then + if Timestamp.geq auditor.last_change validity_start then Error "database has more recent auditor data for this auditor public key" else @@ -200,7 +200,7 @@ module Auditors_disable = struct match opt with | None -> Error "auditor not found" | Some auditor -> ( - match Timestamp.compare auditor.last_change validity_end > 0 with + match Timestamp.geq auditor.last_change validity_end with | true -> Error "database has more recent auditor data for this auditor public \ diff --git a/src/time.ml b/src/time.ml index cf2d2093..b05cf5fb 100644 --- a/src/time.ml +++ b/src/time.ml @@ -101,6 +101,7 @@ module Timestamp = struct let geq a b = compare a b >= 0 let lt a b = compare a b < 0 let leq a b = compare a b <= 0 + let equal a b = compare a b = 0 let min a b = if compare a b < 0 then a else b let max a b = if compare a b > 0 then a else b diff --git a/src/time.mli b/src/time.mli index c5ed5b14..dc4bd841 100644 --- a/src/time.mli +++ b/src/time.mli @@ -41,6 +41,7 @@ module Timestamp : sig val geq : t -> t -> bool val lt : t -> t -> bool val leq : t -> t -> bool + val equal : t -> t -> bool val min : t -> t -> t val max : t -> t -> t val diff : t -> t -> TimeRelative.t