@@ -13,14 +13,13 @@ use graph::blockchain::block_stream::{BlockStreamMetrics, TriggersAdapterWrapper
1313use graph:: blockchain:: { Blockchain , BlockchainKind , DataSource , NodeCapabilities } ;
1414use graph:: components:: metrics:: gas:: GasMetrics ;
1515use graph:: components:: metrics:: subgraph:: DeploymentStatusMetric ;
16- use graph:: components:: store:: ReadStore ;
16+ use graph:: components:: store:: SourceableStore ;
1717use graph:: components:: subgraph:: ProofOfIndexingVersion ;
1818use graph:: data:: subgraph:: { UnresolvedSubgraphManifest , SPEC_VERSION_0_0_6 } ;
1919use graph:: data:: value:: Word ;
2020use graph:: data_source:: causality_region:: CausalityRegionSeq ;
2121use graph:: env:: EnvVars ;
2222use graph:: prelude:: { SubgraphInstanceManager as SubgraphInstanceManagerTrait , * } ;
23- use graph:: semver:: Version ;
2423use graph:: { blockchain:: BlockchainMap , components:: store:: DeploymentLocator } ;
2524use graph_runtime_wasm:: module:: ToAscPtr ;
2625use graph_runtime_wasm:: RuntimeHostBuilder ;
@@ -232,48 +231,27 @@ impl<S: SubgraphStore> SubgraphInstanceManager<S> {
232231
233232 pub async fn hashes_to_read_store < C : Blockchain > (
234233 & self ,
235- logger : & Logger ,
236- link_resolver : & Arc < dyn LinkResolver > ,
237234 hashes : Vec < DeploymentHash > ,
238- max_spec_version : Version ,
239235 is_runner_test : bool ,
240- ) -> anyhow:: Result < Vec < ( DeploymentHash , Arc < dyn ReadStore > ) > > {
241- let mut writable_stores = Vec :: new ( ) ;
236+ ) -> anyhow:: Result < Vec < ( DeploymentHash , Arc < dyn SourceableStore > ) > > {
237+ let mut sourceable_stores = Vec :: new ( ) ;
242238 let subgraph_store = self . subgraph_store . clone ( ) ;
243239
244240 if is_runner_test {
245- return Ok ( writable_stores ) ;
241+ return Ok ( sourceable_stores ) ;
246242 }
247243
248244 for hash in hashes {
249- let file_bytes = link_resolver
250- . cat ( logger, & hash. to_ipfs_link ( ) )
251- . await
252- . map_err ( SubgraphAssignmentProviderError :: ResolveError ) ?;
253- let raw: serde_yaml:: Mapping = serde_yaml:: from_slice ( & file_bytes)
254- . map_err ( |e| SubgraphAssignmentProviderError :: ResolveError ( e. into ( ) ) ) ?;
255- let manifest = UnresolvedSubgraphManifest :: < C > :: parse ( hash. cheap_clone ( ) , raw) ?;
256- let manifest = manifest
257- . resolve ( & link_resolver, & logger, max_spec_version. clone ( ) )
258- . await ?;
259-
260245 let loc = subgraph_store
261246 . active_locator ( & hash) ?
262247 . ok_or_else ( || anyhow ! ( "no active deployment for hash {}" , hash) ) ?;
263248
264- let readable_store = subgraph_store
265- . clone ( )
266- . readable (
267- logger. clone ( ) ,
268- loc. id . clone ( ) ,
269- Arc :: new ( manifest. template_idx_and_name ( ) . collect ( ) ) ,
270- )
271- . await ?;
249+ let sourceable_store = subgraph_store. clone ( ) . sourceable ( loc. id . clone ( ) ) . await ?;
272250
273- writable_stores . push ( ( loc. hash , readable_store ) ) ;
251+ sourceable_stores . push ( ( loc. hash , sourceable_store ) ) ;
274252 }
275253
276- Ok ( writable_stores )
254+ Ok ( sourceable_stores )
277255 }
278256
279257 pub async fn build_subgraph_runner < C > (
@@ -540,13 +518,7 @@ impl<S: SubgraphStore> SubgraphInstanceManager<S> {
540518 let decoder = Box :: new ( Decoder :: new ( decoder_hook) ) ;
541519
542520 let subgraph_data_source_read_stores = self
543- . hashes_to_read_store :: < C > (
544- & logger,
545- & link_resolver,
546- subgraph_ds_source_deployments,
547- manifest. spec_version . clone ( ) ,
548- is_runner_test,
549- )
521+ . hashes_to_read_store :: < C > ( subgraph_ds_source_deployments, is_runner_test)
550522 . await ?;
551523
552524 let triggers_adapter = Arc :: new ( TriggersAdapterWrapper :: new (
0 commit comments