diff --git a/registry/src/lib.rs b/registry/src/lib.rs index 2a9a5c7..5140756 100644 --- a/registry/src/lib.rs +++ b/registry/src/lib.rs @@ -71,7 +71,7 @@ where timestamp_ns: method .id .get_query_value("timestmap")? - .parse::() + .parse::() .ok()?, }) }) @@ -82,7 +82,9 @@ where message: "Identities retrieved".to_string(), installations: installations .into_iter() - .filter(|i| i.timestamp_ns > start_time_ns) + // the only way an i64 cannot fit into a u64 if it's negative, so we can safely set + // to 0 + .filter(|i| i.timestamp_ns > start_time_ns.try_into().unwrap_or(0)) .collect(), }) } diff --git a/xps-types/src/lib.rs b/xps-types/src/lib.rs index cf17bba..43718a4 100644 --- a/xps-types/src/lib.rs +++ b/xps-types/src/lib.rs @@ -117,7 +117,7 @@ pub struct InstallationId { // installation id pub id: Bytes, /// Timestamp in nanoseconds of the block which the operation took place - pub timestamp_ns: i64, + pub timestamp_ns: u64, } #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]