@@ -544,6 +544,14 @@ where
544544 block : BlockWithTriggers < C > ,
545545 firehose_cursor : FirehoseCursor ,
546546 ) -> Result < Action , ProcessingError > {
547+ fn log_triggers_found < C : Blockchain > ( logger : & Logger , triggers : & [ Trigger < C > ] ) {
548+ if triggers. len ( ) == 1 {
549+ info ! ( logger, "1 trigger found in this block" ) ;
550+ } else if triggers. len ( ) > 1 {
551+ info ! ( logger, "{} triggers found in this block" , triggers. len( ) ) ;
552+ }
553+ }
554+
547555 let triggers = block. trigger_data ;
548556 let block = Arc :: new ( block. block ) ;
549557 let block_ptr = block. ptr ( ) ;
@@ -711,19 +719,7 @@ where
711719 . non_deterministic ( ) ?;
712720
713721 let triggers = block_with_triggers. trigger_data ;
714-
715- if triggers. len ( ) == 1 {
716- info ! (
717- & logger,
718- "1 trigger found in this block for the new data sources"
719- ) ;
720- } else if triggers. len ( ) > 1 {
721- info ! (
722- & logger,
723- "{} triggers found in this block for the new data sources" ,
724- triggers. len( )
725- ) ;
726- }
722+ log_triggers_found ( & logger, & triggers) ;
727723
728724 // Add entity operations for the new data sources to the block state
729725 // and add runtimes for the data sources to the subgraph instance.
0 commit comments