@@ -544,6 +544,14 @@ where
544
544
block : BlockWithTriggers < C > ,
545
545
firehose_cursor : FirehoseCursor ,
546
546
) -> 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
+
547
555
let triggers = block. trigger_data ;
548
556
let block = Arc :: new ( block. block ) ;
549
557
let block_ptr = block. ptr ( ) ;
@@ -711,19 +719,7 @@ where
711
719
. non_deterministic ( ) ?;
712
720
713
721
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) ;
727
723
728
724
// Add entity operations for the new data sources to the block state
729
725
// and add runtimes for the data sources to the subgraph instance.
0 commit comments