diff --git a/src/config.rs b/src/config.rs index 814e5ea..a6c927e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,5 @@ use serde::{self, Deserialize, Deserializer}; use starknet::core::types::FieldElement; -use std::collections::HashMap; use std::env; use std::fs; diff --git a/src/endpoints/achievements/verify_seniority.rs b/src/endpoints/achievements/verify_seniority.rs index 036c827..0ff48a4 100644 --- a/src/endpoints/achievements/verify_seniority.rs +++ b/src/endpoints/achievements/verify_seniority.rs @@ -12,7 +12,7 @@ use axum::{ Json, }; use axum_auto_routes::route; -use chrono::{NaiveDateTime, Utc}; +use chrono::{Utc, DateTime}; use serde_json::json; use starknet::core::types::FieldElement; @@ -33,9 +33,10 @@ pub async fn handler( match execute_has_deployed_time(state.clone(), &query.addr).await { Ok(timestamp) => { - let dt = NaiveDateTime::from_timestamp_opt(timestamp as i64, 0).unwrap(); - let current_time = Utc::now().naive_utc(); - let duration = current_time - dt; + + let date_time = DateTime::from_timestamp(timestamp as i64, 0).unwrap(); + let current_time = Utc::now(); + let duration = current_time - date_time; let days_passed = duration.num_days(); if (achievement_id == 14 && days_passed >= 90) || (achievement_id == 15 && days_passed >= 180)