Skip to content

Commit

Permalink
fix: update to latest SubgraphClient API
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis committed Nov 13, 2023
1 parent 69fbb17 commit 89d7a43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions common/src/indexer_service/http/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct IndexerServiceConfig {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GraphNodeConfig {
pub status_url: String,
pub query_base_url: String,
}

Expand Down
18 changes: 14 additions & 4 deletions common/src/indexer_service/http/indexer_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,22 @@ impl IndexerService {
let metrics = IndexerServiceMetrics::new(options.metrics_prefix);

let network_subgraph = Box::leak(Box::new(SubgraphClient::new(
reqwest::Client::new(),
options
.config
.graph_node
.as_ref()
.zip(options.config.network_subgraph.deployment)
.map(|(graph_node, deployment)| {
DeploymentDetails::for_graph_node(&graph_node.query_base_url, deployment)
DeploymentDetails::for_graph_node(
&graph_node.status_url,
&graph_node.query_base_url,
deployment,
)
})
.transpose()?,
DeploymentDetails::for_query_url(&options.config.network_subgraph.query_url)?,
)?));
)));

// Identify the dispute manager for the configured network
let dispute_manager = dispute_manager(
Expand All @@ -215,17 +220,22 @@ impl IndexerService {
);

let escrow_subgraph = Box::leak(Box::new(SubgraphClient::new(
reqwest::Client::new(),
options
.config
.graph_node
.as_ref()
.zip(options.config.escrow_subgraph.deployment)
.map(|(graph_node, deployment)| {
DeploymentDetails::for_graph_node(&graph_node.query_base_url, deployment)
DeploymentDetails::for_graph_node(
&graph_node.status_url,
&graph_node.query_base_url,
deployment,
)
})
.transpose()?,
DeploymentDetails::for_query_url(&options.config.escrow_subgraph.query_url)?,
)?));
)));

let escrow_accounts = escrow_accounts(
escrow_subgraph,
Expand Down

0 comments on commit 89d7a43

Please sign in to comment.