diff --git a/Cargo.lock b/Cargo.lock index 97d71a294b2..a14c992b026 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3702,7 +3702,7 @@ dependencies = [ "clap", "csv", "defer", - "derivative", + "derive_more", "diesel", "diesel_derives", "envconfig", diff --git a/Cargo.toml b/Cargo.toml index 7dce938d723..9a3a462592c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ chrono = "0.4.43" bs58 = "0.5.1" clap = { version = "4.5.4", features = ["derive", "env", "wrap_help"] } clap_complete = "4" -derivative = "2.2.0" +derive_more = { version = "2.1.1", default-features = false } diesel = { version = "2.2.7", features = [ "postgres", "serde_json", diff --git a/graph/Cargo.toml b/graph/Cargo.toml index f7398298927..92a2916bcf7 100644 --- a/graph/Cargo.toml +++ b/graph/Cargo.toml @@ -19,7 +19,7 @@ old_bigdecimal = { version = "=0.1.2", features = [ bytes = "1.0.1" bs58 = { workspace = true } cid = "0.11.1" -derivative = { workspace = true } +derive_more = { workspace = true, features = ["debug"] } graph_derive = { path = "./derive" } diesel = { workspace = true } diesel_derives = { workspace = true } diff --git a/graph/src/components/link_resolver/ipfs.rs b/graph/src/components/link_resolver/ipfs.rs index 07b7777e5ba..f71a73ea5bb 100644 --- a/graph/src/components/link_resolver/ipfs.rs +++ b/graph/src/components/link_resolver/ipfs.rs @@ -4,7 +4,7 @@ use std::time::Duration; use anyhow::anyhow; use async_trait::async_trait; use bytes::BytesMut; -use derivative::Derivative; +use derive_more::Debug; use futures03::compat::Stream01CompatExt; use futures03::stream::StreamExt; use futures03::stream::TryStreamExt; @@ -22,10 +22,9 @@ use crate::prelude::*; use super::{LinkResolver, LinkResolverContext}; -#[derive(Clone, CheapClone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, CheapClone, Debug)] pub struct IpfsResolver { - #[derivative(Debug = "ignore")] + #[debug(skip)] client: Arc, timeout: Duration, diff --git a/graph/src/components/network_provider/provider_manager.rs b/graph/src/components/network_provider/provider_manager.rs index 54454df40f6..3c1a6e3196a 100644 --- a/graph/src/components/network_provider/provider_manager.rs +++ b/graph/src/components/network_provider/provider_manager.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use std::sync::OnceLock; use std::time::Duration; -use derivative::Derivative; +use derive_more::Debug; use itertools::Itertools; use slog::info; use slog::warn; @@ -24,10 +24,9 @@ const VALIDATION_MAX_DURATION: Duration = Duration::from_secs(30); const VALIDATION_RETRY_INTERVAL: Duration = Duration::from_secs(300); /// ProviderManager is responsible for validating providers before they are returned to consumers. -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct ProviderManager { - #[derivative(Debug = "ignore")] + #[debug(skip)] inner: Arc>, validation_max_duration: Duration, diff --git a/graph/src/ipfs/gateway_client.rs b/graph/src/ipfs/gateway_client.rs index 0a7d3ac34ad..91a9126e4f1 100644 --- a/graph/src/ipfs/gateway_client.rs +++ b/graph/src/ipfs/gateway_client.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::anyhow; use async_trait::async_trait; -use derivative::Derivative; +use derive_more::Debug; use http::header::ACCEPT; use http::header::CACHE_CONTROL; use reqwest::{redirect::Policy as RedirectPolicy, StatusCode}; @@ -17,12 +17,11 @@ use crate::ipfs::{ /// A client that connects to an IPFS gateway. /// /// Reference: -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct IpfsGatewayClient { server_address: ServerAddress, - #[derivative(Debug = "ignore")] + #[debug(skip)] http_client: reqwest::Client, metrics: IpfsMetrics, diff --git a/graph/src/ipfs/rpc_client.rs b/graph/src/ipfs/rpc_client.rs index 92e9e787ec8..1838036c6ec 100644 --- a/graph/src/ipfs/rpc_client.rs +++ b/graph/src/ipfs/rpc_client.rs @@ -1,9 +1,8 @@ use std::sync::Arc; -use std::time::Duration; use anyhow::anyhow; use async_trait::async_trait; -use derivative::Derivative; +use derive_more::Debug; use http::header::CONTENT_LENGTH; use reqwest::Response; use reqwest::StatusCode; @@ -18,17 +17,15 @@ use crate::ipfs::{ /// A client that connects to an IPFS RPC API. /// /// Reference: -#[derive(Clone, Derivative)] -#[derivative(Debug)] +#[derive(Clone, Debug)] pub struct IpfsRpcClient { server_address: ServerAddress, - #[derivative(Debug = "ignore")] + #[debug(skip)] http_client: reqwest::Client, metrics: IpfsMetrics, logger: Logger, - test_request_timeout: Duration, } impl IpfsRpcClient { @@ -64,7 +61,6 @@ impl IpfsRpcClient { http_client: reqwest::Client::new(), metrics, logger: logger.to_owned(), - test_request_timeout: ENV_VARS.ipfs_request_timeout, }) } @@ -140,6 +136,8 @@ impl IpfsClient for IpfsRpcClient { #[cfg(test)] mod tests { + use std::time::Duration; + use bytes::BytesMut; use futures03::TryStreamExt; use wiremock::matchers as m; diff --git a/store/postgres/Cargo.toml b/store/postgres/Cargo.toml index 191a6dc2f13..f9ede51cc9a 100644 --- a/store/postgres/Cargo.toml +++ b/store/postgres/Cargo.toml @@ -8,7 +8,7 @@ async-trait = { workspace = true } blake3 = "1.8" chrono = { workspace = true } deadpool = { workspace = true } -derive_more = { version = "2.1.1", features = ["full"] } +derive_more = { workspace = true, features = ["full"] } diesel = { workspace = true } diesel-async = { workspace = true } diesel-dynamic-schema = { workspace = true }