Skip to content
Open
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
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
7 changes: 3 additions & 4 deletions graph/src/components/link_resolver/ipfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<dyn IpfsClient>,

timeout: Duration,
Expand Down
7 changes: 3 additions & 4 deletions graph/src/components/network_provider/provider_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<T: NetworkDetails> {
#[derivative(Debug = "ignore")]
#[debug(skip)]
inner: Arc<Inner<T>>,

validation_max_duration: Duration,
Expand Down
7 changes: 3 additions & 4 deletions graph/src/ipfs/gateway_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -17,12 +17,11 @@ use crate::ipfs::{
/// A client that connects to an IPFS gateway.
///
/// Reference: <https://specs.ipfs.tech/http-gateways/path-gateway>
#[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,
Expand Down
12 changes: 5 additions & 7 deletions graph/src/ipfs/rpc_client.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -18,17 +17,15 @@ use crate::ipfs::{
/// A client that connects to an IPFS RPC API.
///
/// Reference: <https://docs.ipfs.tech/reference/kubo/rpc>
#[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 {
Expand Down Expand Up @@ -64,7 +61,6 @@ impl IpfsRpcClient {
http_client: reqwest::Client::new(),
metrics,
logger: logger.to_owned(),
test_request_timeout: ENV_VARS.ipfs_request_timeout,
})
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion store/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down