@@ -5,6 +5,7 @@ use alloy::dyn_abi::Eip712Domain;
55use anyhow;
66use axum:: extract:: MatchedPath ;
77use axum:: extract:: Request as ExtractRequest ;
8+ use axum:: handler:: Handler ;
89use axum:: http:: { Method , Request } ;
910use axum:: {
1011 async_trait,
@@ -414,7 +415,7 @@ impl IndexerService {
414415 "/network" ,
415416 post ( static_subgraph_request_handler)
416417 . route_layer ( auth_layer)
417- . route_layer ( Extension ( network_subgraph) )
418+ . with_state ( network_subgraph)
418419 . route_layer ( static_subgraph_rate_limiter. clone ( ) ) ,
419420 ) ;
420421 } else {
@@ -428,14 +429,13 @@ impl IndexerService {
428429
429430 let auth_layer = ValidateRequestHeaderLayer :: bearer ( free_auth_token) ;
430431
431- misc_routes = misc_routes
432- . route (
433- "/escrow" ,
434- post ( static_subgraph_request_handler)
435- . route_layer ( auth_layer)
436- . route_layer ( Extension ( escrow_subgraph) ) ,
437- )
438- . route_layer ( static_subgraph_rate_limiter) ;
432+ misc_routes = misc_routes. route (
433+ "/escrow" ,
434+ post ( static_subgraph_request_handler)
435+ . route_layer ( auth_layer)
436+ . with_state ( escrow_subgraph)
437+ . route_layer ( static_subgraph_rate_limiter) ,
438+ )
439439 } else {
440440 warn ! ( "`serve_escrow_subgraph` is enabled but no `serve_auth_token` provided. Disabling it." ) ;
441441 }
0 commit comments