This commit is contained in:
swrup 2026-02-26 17:14:31 +01:00
parent a1269be5b1
commit f37d851406
4 changed files with 6 additions and 4 deletions

View file

@ -68,7 +68,7 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
| Some timestamp -> | Some timestamp ->
List.find_map List.find_map
(fun v -> (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 Some v.stamp_start
else None) else None)
denom_l denom_l
@ -77,7 +77,7 @@ let mk_keys ~db_conn (module Keys : Keys.S) ~last_issue_date =
| None -> denom_l | None -> denom_l
| Some timestamp -> | Some timestamp ->
List.filter List.filter
(fun v -> Timestamp.compare v.Denomination.stamp_start timestamp >= 0) (fun v -> Timestamp.geq v.Denomination.stamp_start timestamp)
denom_l denom_l
in in
let* denominations = Denomination.make_denom_group_sorted denom_l in let* denominations = Denomination.make_denom_group_sorted denom_l in

View file

@ -164,7 +164,7 @@ module Auditors = struct
Logs.info (fun m -> m "enabled auditor"); Logs.info (fun m -> m "enabled auditor");
() ()
| Some auditor -> | Some auditor ->
if Timestamp.compare auditor.last_change validity_start > 0 then if Timestamp.geq auditor.last_change validity_start then
Error Error
"database has more recent auditor data for this auditor public key" "database has more recent auditor data for this auditor public key"
else else
@ -200,7 +200,7 @@ module Auditors_disable = struct
match opt with match opt with
| None -> Error "auditor not found" | None -> Error "auditor not found"
| Some auditor -> ( | Some auditor -> (
match Timestamp.compare auditor.last_change validity_end > 0 with match Timestamp.geq auditor.last_change validity_end with
| true -> | true ->
Error Error
"database has more recent auditor data for this auditor public \ "database has more recent auditor data for this auditor public \

View file

@ -101,6 +101,7 @@ module Timestamp = struct
let geq a b = compare a b >= 0 let geq a b = compare a b >= 0
let lt a b = compare a b < 0 let lt a b = compare a b < 0
let leq 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 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 let max a b = if compare a b > 0 then a else b

View file

@ -41,6 +41,7 @@ module Timestamp : sig
val geq : t -> t -> bool val geq : t -> t -> bool
val lt : t -> t -> bool val lt : t -> t -> bool
val leq : t -> t -> bool val leq : t -> t -> bool
val equal : t -> t -> bool
val min : t -> t -> t val min : t -> t -> t
val max : t -> t -> t val max : t -> t -> t
val diff : t -> t -> TimeRelative.t val diff : t -> t -> TimeRelative.t