@@ -200,36 +200,39 @@ impl IndexerService {
200200 . build ( )
201201 . expect ( "Failed to init HTTP client" ) ;
202202
203- let network_subgraph: & ' static SubgraphClient = Box :: leak ( Box :: new ( SubgraphClient :: new (
204- http_client. clone ( ) ,
205- options
206- . config
207- . subgraphs
208- . network
209- . config
210- . deployment_id
211- . map ( |deployment| {
212- DeploymentDetails :: for_graph_node_url (
213- options. config . graph_node . status_url . clone ( ) ,
214- options. config . graph_node . query_url . clone ( ) ,
215- deployment,
216- )
217- } )
218- . transpose ( )
219- . expect (
220- "Failed to parse graph node query endpoint and network subgraph deployment" ,
221- ) ,
222- DeploymentDetails :: for_query_url_with_token (
223- options. config . subgraphs . network . config . query_url . as_ref ( ) ,
203+ let network_subgraph: & ' static SubgraphClient = Box :: leak ( Box :: new (
204+ SubgraphClient :: new (
205+ http_client. clone ( ) ,
224206 options
225207 . config
226208 . subgraphs
227209 . network
228210 . config
229- . query_auth_token
230- . clone ( ) ,
231- ) ?,
232- ) ) ) ;
211+ . deployment_id
212+ . map ( |deployment| {
213+ DeploymentDetails :: for_graph_node_url (
214+ options. config . graph_node . status_url . clone ( ) ,
215+ options. config . graph_node . query_url . clone ( ) ,
216+ deployment,
217+ )
218+ } )
219+ . transpose ( )
220+ . expect (
221+ "Failed to parse graph node query endpoint and network subgraph deployment" ,
222+ ) ,
223+ DeploymentDetails :: for_query_url_with_token (
224+ options. config . subgraphs . network . config . query_url . as_ref ( ) ,
225+ options
226+ . config
227+ . subgraphs
228+ . network
229+ . config
230+ . query_auth_token
231+ . clone ( ) ,
232+ ) ?,
233+ )
234+ . await ,
235+ ) ) ;
233236
234237 // Identify the dispute manager for the configured network
235238 let dispute_manager = dispute_manager ( network_subgraph, Duration :: from_secs ( 3600 ) )
@@ -264,34 +267,39 @@ impl IndexerService {
264267 dispute_manager,
265268 ) ;
266269
267- let escrow_subgraph: & ' static SubgraphClient = Box :: leak ( Box :: new ( SubgraphClient :: new (
268- http_client,
269- options
270- . config
271- . subgraphs
272- . escrow
273- . config
274- . deployment_id
275- . map ( |deployment| {
276- DeploymentDetails :: for_graph_node_url (
277- options. config . graph_node . status_url . clone ( ) ,
278- options. config . graph_node . query_url . clone ( ) ,
279- deployment,
280- )
281- } )
282- . transpose ( )
283- . expect ( "Failed to parse graph node query endpoint and escrow subgraph deployment" ) ,
284- DeploymentDetails :: for_query_url_with_token (
285- options. config . subgraphs . escrow . config . query_url . as_ref ( ) ,
270+ let escrow_subgraph: & ' static SubgraphClient = Box :: leak ( Box :: new (
271+ SubgraphClient :: new (
272+ http_client,
286273 options
287274 . config
288275 . subgraphs
289276 . escrow
290277 . config
291- . query_auth_token
292- . clone ( ) ,
293- ) ?,
294- ) ) ) ;
278+ . deployment_id
279+ . map ( |deployment| {
280+ DeploymentDetails :: for_graph_node_url (
281+ options. config . graph_node . status_url . clone ( ) ,
282+ options. config . graph_node . query_url . clone ( ) ,
283+ deployment,
284+ )
285+ } )
286+ . transpose ( )
287+ . expect (
288+ "Failed to parse graph node query endpoint and escrow subgraph deployment" ,
289+ ) ,
290+ DeploymentDetails :: for_query_url_with_token (
291+ options. config . subgraphs . escrow . config . query_url . as_ref ( ) ,
292+ options
293+ . config
294+ . subgraphs
295+ . escrow
296+ . config
297+ . query_auth_token
298+ . clone ( ) ,
299+ ) ?,
300+ )
301+ . await ,
302+ ) ) ;
295303
296304 let escrow_accounts = escrow_accounts (
297305 escrow_subgraph,
0 commit comments