Skip to content

Commit

Permalink
chore(deps): update rust crate thegraph-core to v0.x.x
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Delgado <[email protected]>
  • Loading branch information
LNSD committed Nov 9, 2024
1 parent f1ee91d commit dcfc1a6
Show file tree
Hide file tree
Showing 27 changed files with 1,104 additions and 150 deletions.
1,154 changes: 1,043 additions & 111 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ inherits = "release"
debug = true

[dependencies]
alloy-primitives = { version = "0.8.11", features = ["serde"] }
alloy-signer-local = "0.5.4"
alloy-sol-types = "0.8.11"
anyhow = "1.0"
Expand Down Expand Up @@ -59,7 +58,7 @@ serde_with = "3.8.1"
simple-rate-limiter = "1.0"
snmalloc-rs = "0.3"
tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", rev = "61b47b3" }
thegraph-core = { version = "0.7.0", features = ["serde"] }
thegraph-core = "0.8.1"
thegraph-graphql-http = { version = "0.2.1", features = [
"http-client-reqwest",
] }
Expand Down
2 changes: 1 addition & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub fn is_domain_authorized<S: AsRef<str>>(authorized: &[S], origin: &str) -> bo

#[cfg(test)]
mod tests {
use alloy_primitives::hex;
use thegraph_core::alloy::primitives::hex;

use super::{is_domain_authorized, parse_api_key};

Expand Down
4 changes: 2 additions & 2 deletions src/block_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use graphql::{
};
use itertools::Itertools as _;
use serde_json::{self, json};
use thegraph_core::{BlockHash, BlockNumber};
use thegraph_core::alloy::primitives::{BlockHash, BlockNumber};

use crate::{
blocks::{BlockConstraint, UnresolvedBlock},
Expand Down Expand Up @@ -304,7 +304,7 @@ fn parse_number<'c, T: Text<'c>>(
mod tests {
use std::iter::FromIterator as _;

use alloy_primitives::hex;
use thegraph_core::alloy::primitives::hex;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion src/blocks.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt;

use serde::Deserialize;
use thegraph_core::{BlockHash, BlockNumber, BlockTimestamp};
use thegraph_core::alloy::primitives::{BlockHash, BlockNumber, BlockTimestamp};

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize)]
pub struct Block {
Expand Down
6 changes: 4 additions & 2 deletions src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ impl Chain {

#[cfg(test)]
mod tests {
use alloy_primitives::U256;
use itertools::Itertools;
use rand::{
rngs::SmallRng, seq::SliceRandom as _, thread_rng, Rng as _, RngCore as _, SeedableRng,
};
use thegraph_core::{Address, BlockHash, IndexerId};
use thegraph_core::{
alloy::primitives::{Address, BlockHash, U256},
IndexerId,
};
use toolshed::concat_bytes;

use super::{Block, Chain, MAX_LEN};
Expand Down
2 changes: 1 addition & 1 deletion src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use prost::bytes::Buf;
use rand::{thread_rng, Rng as _};
use serde::Deserialize;
use serde_json::value::RawValue;
use thegraph_core::{AllocationId, BlockNumber, DeploymentId, IndexerId};
use thegraph_core::{alloy::primitives::BlockNumber, AllocationId, DeploymentId, IndexerId};
use tokio::sync::mpsc;
use tracing::{info_span, Instrument as _};
use url::Url;
Expand Down
2 changes: 1 addition & 1 deletion src/client_query/context.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_sol_types::Eip712Domain;
use ordered_float::NotNan;
use thegraph_core::alloy::sol_types::Eip712Domain;
use tokio::sync::{mpsc, watch};

use crate::{
Expand Down
6 changes: 4 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{
str::FromStr,
};

use alloy_primitives::{B256, U256};
use anyhow::Context;
use custom_debug::CustomDebug;
use ipnetwork::IpNetwork;
Expand All @@ -16,7 +15,10 @@ use secp256k1::SecretKey;
use semver::Version;
use serde::Deserialize;
use serde_with::{serde_as, DeserializeAs, DisplayFromStr};
use thegraph_core::{Address, DeploymentId};
use thegraph_core::{
alloy::primitives::{Address, B256, U256},
DeploymentId,
};
use url::Url;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use axum::response::{IntoResponse, Response};
use itertools::Itertools as _;
use thegraph_core::{BlockNumber, IndexerId};
use thegraph_core::{alloy::primitives::BlockNumber, IndexerId};

use crate::{blocks::UnresolvedBlock, graphql};

Expand Down
6 changes: 4 additions & 2 deletions src/indexer_client.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use alloy_sol_types::Eip712Domain;
use reqwest::header::AUTHORIZATION;
use serde::{Deserialize, Serialize};
use thegraph_core::{
alloy::{
primitives::{BlockHash, BlockNumber},
sol_types::Eip712Domain,
},
attestation::{self, Attestation},
BlockHash, BlockNumber,
};
use thegraph_graphql_http::http::response::Error as GQLError;
use url::Url;
Expand Down
2 changes: 1 addition & 1 deletion src/indexers/indexing_progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::Deserialize;
use serde_with::serde_as;
use thegraph_core::{BlockNumber, DeploymentId};
use thegraph_core::{alloy::primitives::BlockNumber, DeploymentId};
use thegraph_graphql_http::{
graphql::{Document, IntoDocument, IntoDocumentWithVariables},
http_client::{RequestError, ReqwestExt as _, ResponseError},
Expand Down
4 changes: 2 additions & 2 deletions src/indexers/public_poi.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use serde_with::{serde_as, DisplayFromStr};
use thegraph_core::{BlockNumber, DeploymentId, ProofOfIndexing};
use thegraph_core::{alloy::primitives::BlockNumber, DeploymentId, ProofOfIndexing};
use thegraph_graphql_http::{
graphql::{Document, IntoDocument, IntoDocumentWithVariables},
http_client::{RequestError, ReqwestExt, ResponseError},
Expand Down Expand Up @@ -166,7 +166,7 @@ pub struct PartialBlockPtr {

#[cfg(test)]
mod tests {
use thegraph_core::{deployment_id, poi};
use thegraph_core::{deployment_id, proof_of_indexing as poi};

use super::Response;

Expand Down
2 changes: 1 addition & 1 deletion src/indexing_performance.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, ops::Deref, time::Duration};

use parking_lot::RwLock;
use thegraph_core::{BlockNumber, DeploymentId, IndexerId};
use thegraph_core::{alloy::primitives::BlockNumber, DeploymentId, IndexerId};
use tokio::{self, sync::mpsc, time::MissedTickBehavior};

use crate::network::NetworkService;
Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
time::Duration,
};

use alloy_sol_types::Eip712Domain;
use axum::{
body::Body,
extract::{ConnectInfo, DefaultBodyLimit, State},
Expand Down Expand Up @@ -40,7 +39,13 @@ use prometheus::{self, Encoder as _};
use secp256k1::SecretKey;
use serde_json::json;
use simple_rate_limiter::RateLimiter;
use thegraph_core::{attestation, Address, ChainId};
use thegraph_core::{
alloy::{
primitives::{Address, ChainId},
sol_types::Eip712Domain,
},
attestation,
};
use tokio::{
net::TcpListener,
signal::unix::SignalKind,
Expand Down
2 changes: 1 addition & 1 deletion src/network/indexer_indexing_poi_blocklist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use std::collections::{HashMap, HashSet};

use thegraph_core::{BlockNumber, DeploymentId, ProofOfIndexing};
use thegraph_core::{alloy::primitives::BlockNumber, DeploymentId, ProofOfIndexing};

use crate::indexers::public_poi::ProofOfIndexingInfo;

Expand Down
2 changes: 1 addition & 1 deletion src/network/indexer_indexing_poi_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use std::{collections::HashMap, time::Duration};

use parking_lot::RwLock;
use thegraph_core::{BlockNumber, DeploymentId, ProofOfIndexing};
use thegraph_core::{alloy::primitives::BlockNumber, DeploymentId, ProofOfIndexing};
use url::Url;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/network/indexer_indexing_progress_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::{collections::HashMap, time::Duration};

use parking_lot::{Mutex, RwLock};
use thegraph_core::{BlockNumber, DeploymentId};
use thegraph_core::{alloy::primitives::BlockNumber, DeploymentId};
use url::Url;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/network/internal/indexer_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cost_model::CostModel;
use custom_debug::CustomDebug;
use ipnetwork::IpNetwork;
use semver::Version;
use thegraph_core::{AllocationId, BlockNumber, DeploymentId, IndexerId};
use thegraph_core::{alloy::primitives::BlockNumber, AllocationId, DeploymentId, IndexerId};
use tracing::Instrument;
use url::Url;

Expand Down
4 changes: 3 additions & 1 deletion src/network/internal/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use std::{
use cost_model::CostModel;
use custom_debug::CustomDebug;
use semver::Version;
use thegraph_core::{AllocationId, BlockNumber, DeploymentId, IndexerId, SubgraphId};
use thegraph_core::{
alloy::primitives::BlockNumber, AllocationId, DeploymentId, IndexerId, SubgraphId,
};
use url::Url;

use super::{DeploymentInfo, SubgraphInfo};
Expand Down
2 changes: 1 addition & 1 deletion src/network/internal/state.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::{BTreeMap, HashSet};

use ipnetwork::IpNetwork;
use thegraph_core::Address;
use thegraph_core::alloy::primitives::Address;

use crate::{
config::BlockedIndexer,
Expand Down
4 changes: 3 additions & 1 deletion src/network/internal/subgraph_processing.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::collections::{HashMap, HashSet};

use thegraph_core::{AllocationId, BlockNumber, DeploymentId, IndexerId, SubgraphId};
use thegraph_core::{
alloy::primitives::BlockNumber, AllocationId, DeploymentId, IndexerId, SubgraphId,
};

use crate::network::errors::{DeploymentError, SubgraphError};

Expand Down
5 changes: 4 additions & 1 deletion src/network/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use std::{

use ipnetwork::IpNetwork;
use semver::Version;
use thegraph_core::{Address, BlockNumber, DeploymentId, SubgraphId};
use thegraph_core::{
alloy::primitives::{Address, BlockNumber},
DeploymentId, SubgraphId,
};
use tokio::{sync::watch, time::MissedTickBehavior};

use super::{
Expand Down
6 changes: 4 additions & 2 deletions src/network/subgraph_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use custom_debug::CustomDebug;
use serde::{ser::SerializeMap, Deserialize, Serialize, Serializer};
use serde_json::json;
use serde_with::serde_as;
use thegraph_core::{BlockHash, BlockNumber, BlockTimestamp};
use thegraph_core::alloy::primitives::{BlockHash, BlockNumber, BlockTimestamp};
use thegraph_graphql_http::http::response::Error as GqlError;
use types::Subgraph;
use url::Url;
Expand All @@ -34,7 +34,9 @@ use crate::{
pub mod types {
use serde::Deserialize;
use serde_with::serde_as;
use thegraph_core::{AllocationId, BlockNumber, DeploymentId, IndexerId, SubgraphId};
use thegraph_core::{
alloy::primitives::BlockNumber, AllocationId, DeploymentId, IndexerId, SubgraphId,
};

#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand Down
14 changes: 9 additions & 5 deletions src/receipts.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
use std::{collections::HashMap, sync::Arc, time::SystemTime};

use alloy_primitives::U256;
use alloy_signer_local::PrivateKeySigner;
use alloy_sol_types::Eip712Domain;
use parking_lot::{Mutex, RwLock};
use rand::RngCore;
pub use receipts::QueryStatus as ReceiptStatus;
use receipts::ReceiptPool;
use secp256k1::SecretKey;
use tap_core::{receipt::Receipt as TapReceipt, signed_message::EIP712SignedMessage};
use thegraph_core::{Address, AllocationId};
use thegraph_core::{
alloy::{
primitives::{Address, U256},
sol_types::Eip712Domain,
},
AllocationId,
};

/// A receipt for an indexer request.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -216,7 +220,7 @@ impl ReceiptSigner {

#[cfg(test)]
mod tests {
use thegraph_core::{address, allocation_id};
use thegraph_core::{allocation_id, alloy::primitives::address};

use super::*;

Expand Down Expand Up @@ -276,7 +280,7 @@ mod tests {
}

mod tap {
use thegraph_core::{address, allocation_id};
use thegraph_core::{allocation_id, alloy::primitives::address};

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion src/reports.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{anyhow, Context};
use ordered_float::NotNan;
use prost::Message;
use thegraph_core::{Address, AllocationId, DeploymentId, IndexerId};
use thegraph_core::{alloy::primitives::Address, AllocationId, DeploymentId, IndexerId};
use tokio::sync::mpsc;
use toolshed::concat_bytes;

Expand Down
3 changes: 1 addition & 2 deletions src/vouchers.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use alloy_primitives::{FixedBytes, U256};
use axum::{body::Bytes, extract::State, http::StatusCode};
use lazy_static::lazy_static;
use receipts::{self, combine_partial_vouchers, receipts_to_partial_voucher, receipts_to_voucher};
use secp256k1::{PublicKey, Secp256k1, SecretKey};
use serde::Deserialize;
use serde_json::json;
use thegraph_core::Address;
use thegraph_core::alloy::primitives::{Address, FixedBytes, U256};

use crate::{
json::{json_response, JsonResponse},
Expand Down

0 comments on commit dcfc1a6

Please sign in to comment.