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 ,
@@ -396,10 +397,10 @@ where
396397 for _ in 0 ..offset {
397398 match parent_getter ( current_ptr. clone ( ) ) . await ? {
398399 Some ( parent) => {
399- if let Some ( root_hash) = & root {
400- if parent. hash == * root_hash {
401- break ;
402- }
400+ if let Some ( root_hash) = & root
401+ && parent. hash == * root_hash
402+ {
403+ break ;
403404 }
404405 current_ptr = parent;
405406 }
@@ -815,8 +816,8 @@ async fn fetch_unique_blocks_from_cache(
815816
816817 // Collect blocks and filter out ones with multiple entries
817818 let blocks: Vec < Arc < ExtendedBlockPtr > > = blocks_map
818- . into_iter ( )
819- . filter_map ( |( _ , values) | {
819+ . into_values ( )
820+ . filter_map ( |values| {
820821 if values. len ( ) == 1 {
821822 Some ( Arc :: new ( values[ 0 ] . clone ( ) ) )
822823 } else {
@@ -1372,7 +1373,9 @@ impl FirehoseMapperTrait<Chain> for FirehoseMapper {
13721373 }
13731374
13741375 StepFinal => {
1375- 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+ )
13761379 }
13771380
13781381 StepUnset => {
0 commit comments