Skip to content

Commit

Permalink
Merge pull request #255 from pheobeayo/cleanup-update
Browse files Browse the repository at this point in the history
cleanup-update
  • Loading branch information
Marchand-Nicolas authored Aug 30, 2024
2 parents e65eb54 + adc3793 commit 7b07258
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use serde::{self, Deserialize, Deserializer};
use starknet::core::types::FieldElement;
use std::collections::HashMap;
use std::env;
use std::fs;

Expand Down
9 changes: 5 additions & 4 deletions src/endpoints/achievements/verify_seniority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit 7b07258

Please sign in to comment.