Skip to content

Commit

Permalink
chore: use workspace dependencies (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
LNSD authored Aug 16, 2023
1 parent fb5dbb0 commit 1c8444f
Show file tree
Hide file tree
Showing 53 changed files with 349 additions and 211 deletions.
31 changes: 24 additions & 7 deletions Cargo.lock

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

19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,22 @@ lto = "thin"
[profile.perf]
inherits = "release"
debug = true


[workspace.dependencies]
anyhow = "1.0"
eventuals = "0.6.7"
primitive-types = "0.12"
rand = { version = "0.8", features = ["small_rng"] }
reqwest = { version = "0.11", default-features = false, features = ["json", "default-tls", "gzip"] }
serde = { version = "1.0", features = ["derive"] }
siphasher = "0.3"
tokio = { version = "1.24", features = [
"macros",
"parking_lot",
"rt-multi-thread",
"sync",
"time",
] }
toolshed = { git = "https://github.com/edgeandnode/toolshed", tag = "v0.1.3" }
tracing = { version = "0.1", default-features = false }
23 changes: 15 additions & 8 deletions graph-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,57 @@ name = "graph-gateway"
version = "13.4.1"

[dependencies]
anyhow.workspace = true
axum = { version = "0.6.15", default-features = false, features = [
"json",
"tokio",
"original-uri",
] }
chrono = { version = "0.4", default-features = false, features = ["clock"] }
ethers = { version = "2.0.3", default-features = false, features = ["abigen"] }
eventuals.workspace = true
faster-hex = "0.8.0"
futures = "0.3"
futures-util = "0.3"
graph-subscriptions = { git = "https://github.com/edgeandnode/subscription-payments", rev = "47c4e9e" }
hdwallet = "0.3"
hex = "0.4"
indexer-selection = { path = "../indexer-selection" }
indoc = "2.0.3"
itertools = "0.11"
lazy_static = "1.4"
maxminddb = "0.23"
parking_lot = "0.12.0"
prelude = { path = "../prelude" }
primitive-types = "0.12"
primitive-types.workspace = true
prometheus = { version = "0.13", default-features = false }
prost = "0.11.8"
rand.workspace = true
rdkafka = { version = "0.33", features = ["gssapi-vendored", "tracing"] }
reqwest.workspace = true
secp256k1 = { version = "0.24", default-features = false }
semver = "1.0"
serde = "1.0"
serde.workspace = true
serde_json = { version = "1.0", features = ["raw_value"] }
serde_with = { version = "3.1", features = ["chrono_0_4"] }
serde_yaml = "0.9"
simple-rate-limiter = "1.0"
tiny-bip39 = "1.0"
trust-dns-resolver = "0.22"
uuid = { version = "1.0", default-features = false, features = ["v4"] }
prost = "0.11.8"
thiserror = "1.0.40"
tiny-bip39 = "1.0"
tokio.workspace = true
toolshed.workspace = true
tower = "0.4.13"
tower-http = { version = "0.4.0", features = ["cors"] }
tracing.workspace = true
tracing-subscriber = { version = "0.3.16", features = [
"env-filter",
"json",
"parking_lot",
] }
indoc = "2.0.3"
trust-dns-resolver = "0.22"
uuid = { version = "1.0", default-features = false, features = ["v4"] }

[dev-dependencies]
assert_matches = "1.5.0"
hyper = "*"
regex = "1.5"
tokio = { version = "1.28.2", features = ["macros"] }
12 changes: 6 additions & 6 deletions graph-gateway/src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::time::Duration;
use std::{
collections::{HashMap, HashSet},
sync::{
Expand All @@ -6,14 +7,13 @@ use std::{
},
};

use anyhow::{anyhow, bail, ensure, Result};
use eventuals::{Eventual, EventualExt, Ptr};
use graph_subscriptions::TicketPayload;
use tokio::sync::RwLock;
use toolshed::bytes::{Address, DeploymentId, SubgraphId};

use prelude::{
anyhow::{anyhow, bail, ensure, Result},
eventuals::EventualExt as _,
tokio::sync::RwLock,
*,
};
use prelude::USD;

use crate::{
price_automation::QueryBudgetFactors,
Expand Down
13 changes: 6 additions & 7 deletions graph-gateway/src/block_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ use std::collections::{BTreeMap, BTreeSet};

use itertools::Itertools as _;
use serde_json::{self, json};

use indexer_selection::{Context, UnresolvedBlock};
use prelude::graphql::graphql_parser::query::{
use toolshed::bytes::Bytes32;
use toolshed::graphql::graphql_parser::query::{
Definition, Document, OperationDefinition, Selection, Text, Value,
};
use prelude::{
graphql::{IntoStaticValue as _, QueryVariables, StaticValue},
*,
};
use toolshed::graphql::{IntoStaticValue as _, QueryVariables, StaticValue};

use indexer_selection::{Context, UnresolvedBlock};
use prelude::BlockPointer;

#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub enum BlockConstraint {
Expand Down
9 changes: 8 additions & 1 deletion graph-gateway/src/chains/ethereum.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
use std::time::Duration;

use reqwest;
use serde::{de::Error, Deserialize, Deserializer};
use serde_json::{json, Value as JSON};
use tokio::sync::mpsc;
use tokio::time::interval;
use toolshed::bytes::Bytes32;
use toolshed::url::Url;
use tracing::Instrument;

use indexer_selection::UnresolvedBlock;
use prelude::{tokio::time::interval, *};
use prelude::{BlockHead, BlockPointer};

use crate::metrics::METRICS;

Expand Down
10 changes: 9 additions & 1 deletion graph-gateway/src/chains/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
use std::collections::{BTreeSet, HashMap};
use std::time::Duration;

use eventuals::{Eventual, EventualWriter};
use tokio::sync::{mpsc, oneshot};
use tokio::time::interval;
use toolshed::bytes::Bytes32;
use tracing::Instrument;

use indexer_selection::UnresolvedBlock;
use prelude::{epoch_cache::EpochCache, tokio::time::interval, *};
use prelude::epoch_cache::EpochCache;
use prelude::{BlockHead, BlockPointer};

use crate::{block_constraints::*, metrics::*};

Expand Down
4 changes: 3 additions & 1 deletion graph-gateway/src/chains/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use tokio::sync::mpsc;

use indexer_selection::UnresolvedBlock;
use prelude::*;
use prelude::{BlockHead, BlockPointer};

use super::ClientMsg;

Expand Down
19 changes: 12 additions & 7 deletions graph-gateway/src/client_query.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::collections::HashSet;
use std::str::FromStr;
use std::time::{Duration, Instant};
use std::{
collections::{BTreeMap, BTreeSet, HashMap},
sync::{
Expand All @@ -7,6 +9,7 @@ use std::{
},
};

use anyhow::{anyhow, bail, Context as _};
use axum::extract::OriginalUri;
use axum::http::{HeaderValue, Request, Uri};
use axum::middleware::Next;
Expand All @@ -16,13 +19,21 @@ use axum::{
http::{header, HeaderMap, Response, StatusCode},
RequestPartsExt,
};
use eventuals::{Eventual, Ptr};
use futures::future::join_all;
use lazy_static::lazy_static;
use prost::bytes::Buf;
use rand::{rngs::SmallRng, SeedableRng as _};
use semver::Version;
use serde::Deserialize;
use serde_json::json;
use serde_json::value::RawValue;
use tokio::sync::mpsc;
use toolshed::bytes::{Address, DeploymentId, SubgraphId};
use toolshed::graphql;
use toolshed::graphql::graphql_parser::query::{OperationDefinition, SelectionSet};
use toolshed::url::Url;
use tracing::Instrument;
use uuid::Uuid;

use indexer_selection::{
Expand All @@ -31,13 +42,7 @@ use indexer_selection::{
Selection, UnresolvedBlock, UtilityParameters, SELECTION_LIMIT,
};
use prelude::{
anyhow::{anyhow, bail, Context as _},
buffer_queue::QueueWriter,
double_buffer::DoubleBufferReader,
graphql::graphql_parser::query::{OperationDefinition, SelectionSet},
rand::{rngs::SmallRng, SeedableRng as _},
url::Url,
DeploymentId, *,
buffer_queue::QueueWriter, double_buffer::DoubleBufferReader, unix_timestamp, BlockPointer, GRT,
};

use crate::{
Expand Down
8 changes: 6 additions & 2 deletions graph-gateway/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
use std::{collections::BTreeMap, path::PathBuf};
use std::str::FromStr;
use std::time::Duration;
use std::{collections::BTreeMap, fmt, path::PathBuf};

use graph_subscriptions::subscription_tier::{SubscriptionTier, SubscriptionTiers};
use hdwallet::{self, KeyChain as _};
use semver::Version;
use serde::Deserialize;
use serde_with::{serde_as, DisplayFromStr, FromInto};
use toolshed::bytes::Address;
use toolshed::url::Url;

use indexer_selection::SecretKey;
use prelude::*;
use prelude::{key_path, USD};

use crate::chains::ethereum;
use crate::poi::ProofOfIndexingInfo;
Expand Down
Loading

0 comments on commit 1c8444f

Please sign in to comment.