Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on chrono to avoid feature unification issues #5035

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ celes = "2.4.0"
cfg-if = "1.0.0"
chacha20 = "0.9.0"
chacha20poly1305 = "0.10.1"
chrono = "0.4.31"
cipher = "0.4.3"
clap = "4.5.20"
clap_complete = "4.5"
Expand Down
1 change: 0 additions & 1 deletion common/gateway-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sqlx = { workspace = true, features = [
"macros",
"migrate",
"time",
"chrono"
] }
time = { workspace = true }
thiserror = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion common/wireguard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license.workspace = true
[dependencies]
base64 = { workspace = true }
bincode = { workspace = true }
chrono = { workspace = true }
time = { workspace = true }
dashmap = { workspace = true }
defguard_wireguard_rs = { workspace = true }
futures = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ deny = [
# is a direct dependency of the otherwise banned crate
#{ crate = "[email protected]", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
{ name = "openssl" },
{ name = "chrono" },
]

# List of features to allow/deny
Expand Down
2 changes: 1 addition & 1 deletion explorer-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
chrono = { workspace = true, features = ["serde"] }
time = { workspace = true }
clap = { workspace = true, features = ["cargo", "derive"] }
dotenvy = { workspace = true }
humantime-serde = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions explorer-api/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::fs::File;
use std::path::Path;

use chrono::{DateTime, Utc};
use log::info;
use nym_mixnet_contract_common::NodeId;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;

use crate::client::ThreadsafeValidatorClient;
use crate::geo_ip::location::ThreadsafeGeoIp;
Expand Down Expand Up @@ -49,7 +49,7 @@ pub struct ExplorerApiStateOnDisk {
pub(crate) country_node_distribution: CountryNodesDistribution,
pub(crate) mixnode_location_cache: MixnodeLocationCache,
pub(crate) gateway_location_cache: GatewayLocationCache,
pub(crate) as_at: DateTime<Utc>,
pub(crate) as_at: OffsetDateTime,
}

#[derive(Clone)]
Expand Down Expand Up @@ -117,7 +117,7 @@ impl ExplorerApiStateContext {
country_node_distribution: self.inner.country_node_distribution.get_all().await,
mixnode_location_cache: self.inner.mixnodes.get_locations().await,
gateway_location_cache: self.inner.gateways.get_locations().await,
as_at: Utc::now(),
as_at: OffsetDateTime::now_utc(),
};
serde_json::to_writer(file, &state).expect("error writing state to disk");
info!("Saved file to '{:?}'", json_file_path.canonicalize());
Expand Down
2 changes: 1 addition & 1 deletion nym-data-observatory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ readme.workspace = true
[dependencies]
anyhow = { workspace = true }
axum = { workspace = true, features = ["tokio"] }
chrono = { workspace = true }
time = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] }
nym-bin-common = { path = "../common/bin-common" }
nym-network-defaults = { path = "../common/network-defaults" }
Expand Down
3 changes: 2 additions & 1 deletion nym-data-observatory/src/db/models.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use utoipa::ToSchema;

use crate::background_task::Response;
Expand All @@ -16,7 +17,7 @@ impl From<Response> for JokeDto {
joke_id: value.joke_id,
joke: value.joke,
// casting not smart, can implicitly panic, don't do this in prod
date_created: chrono::offset::Utc::now().timestamp() as i32,
date_created: OffsetDateTime::now_utc().unix_timestamp() as i32,
}
}
}
2 changes: 1 addition & 1 deletion service-providers/network-requester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ regex = { workspace = true }
reqwest = { workspace = true, features = ["json"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "chrono"]}
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "time"]}
tap = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = [ "net", "rt-multi-thread", "macros" ] }
Expand Down
Loading