1- use anyhow:: { anyhow, bail, Result } ;
21use anyhow:: { Context , Error } ;
2+ use anyhow:: { Result , anyhow, bail} ;
33use async_trait:: async_trait;
44use graph:: blockchain:: client:: ChainClient ;
55use graph:: blockchain:: firehose_block_ingestor:: { FirehoseBlockIngestor , Transforms } ;
@@ -13,26 +13,27 @@ use graph::data::subgraph::UnifiedMappingApiVersion;
1313use graph:: firehose:: { FirehoseEndpoint , FirehoseEndpoints , ForkStep } ;
1414use graph:: futures03:: TryStreamExt ;
1515use graph:: prelude:: {
16- retry , BlockHash , ComponentLoggerConfig , ElasticComponentLoggerConfig , EthereumBlock ,
16+ BlockHash , ComponentLoggerConfig , ElasticComponentLoggerConfig , EthereumBlock ,
1717 EthereumCallCache , LightEthereumBlock , LightEthereumBlockExt , MetricsRegistry , StoreError ,
18+ retry,
1819} ;
1920use graph:: slog:: { debug, error, trace, warn} ;
2021use graph:: {
2122 blockchain:: {
23+ Block , BlockPtr , Blockchain , ChainHeadUpdateListener , IngestorError ,
24+ RuntimeAdapter as RuntimeAdapterTrait , TriggerFilter as _,
2225 block_stream:: {
2326 BlockRefetcher , BlockStreamEvent , BlockWithTriggers , FirehoseError ,
2427 FirehoseMapper as FirehoseMapperTrait , TriggersAdapter as TriggersAdapterTrait ,
2528 } ,
2629 firehose_block_stream:: FirehoseBlockStream ,
27- Block , BlockPtr , Blockchain , ChainHeadUpdateListener , IngestorError ,
28- RuntimeAdapter as RuntimeAdapterTrait , TriggerFilter as _,
2930 } ,
3031 cheap_clone:: CheapClone ,
3132 components:: store:: DeploymentLocator ,
3233 firehose,
3334 prelude:: {
34- o , serde_json as json , BlockNumber , ChainStore , EthereumBlockWithCalls , Logger ,
35- LoggerFactory ,
35+ BlockNumber , ChainStore , EthereumBlockWithCalls , Logger , LoggerFactory , o ,
36+ serde_json as json ,
3637 } ,
3738} ;
3839use prost:: Message ;
@@ -49,17 +50,17 @@ use crate::ingestor::PollingBlockIngestor;
4950use crate :: network:: EthereumNetworkAdapters ;
5051use crate :: polling_block_stream:: PollingBlockStream ;
5152use crate :: runtime:: runtime_adapter:: eth_call_gas;
53+ use crate :: { BufferedCallCache , NodeCapabilities } ;
5254use crate :: {
55+ ENV_VARS , SubgraphEthRpcMetrics , TriggerFilter ,
5356 adapter:: EthereumAdapter as _,
5457 codec,
5558 data_source:: { DataSource , UnresolvedDataSource } ,
5659 ethereum_adapter:: {
5760 blocks_with_triggers, get_calls, parse_block_triggers, parse_call_triggers,
5861 parse_log_triggers,
5962 } ,
60- SubgraphEthRpcMetrics , TriggerFilter , ENV_VARS ,
6163} ;
62- use crate :: { BufferedCallCache , NodeCapabilities } ;
6364use crate :: { EthereumAdapter , RuntimeAdapter } ;
6465use graph:: blockchain:: block_stream:: {
6566 BlockStream , BlockStreamBuilder , BlockStreamError , BlockStreamMapper , FirehoseCursor ,
@@ -397,9 +398,10 @@ where
397398 match parent_getter ( current_ptr. clone ( ) ) . await ? {
398399 Some ( parent) => {
399400 if let Some ( root_hash) = & root
400- && parent. hash == * root_hash {
401- break ;
402- }
401+ && parent. hash == * root_hash
402+ {
403+ break ;
404+ }
403405 current_ptr = parent;
404406 }
405407 None => return Ok ( None ) ,
@@ -813,7 +815,9 @@ async fn fetch_unique_blocks_from_cache(
813815 . unwrap_or_default ( ) ;
814816
815817 // Collect blocks and filter out ones with multiple entries
816- let blocks: Vec < Arc < ExtendedBlockPtr > > = blocks_map. into_values ( ) . filter_map ( |values| {
818+ let blocks: Vec < Arc < ExtendedBlockPtr > > = blocks_map
819+ . into_values ( )
820+ . filter_map ( |values| {
817821 if values. len ( ) == 1 {
818822 Some ( Arc :: new ( values[ 0 ] . clone ( ) ) )
819823 } else {
@@ -1369,7 +1373,9 @@ impl FirehoseMapperTrait<Chain> for FirehoseMapper {
13691373 }
13701374
13711375 StepFinal => {
1372- unreachable ! ( "irreversible step is not handled and should not be requested in the Firehose request" )
1376+ unreachable ! (
1377+ "irreversible step is not handled and should not be requested in the Firehose request"
1378+ )
13731379 }
13741380
13751381 StepUnset => {
0 commit comments