@@ -100,6 +100,7 @@ pub struct L1Watcher<EP> {
100100 /// The log query block range.
101101 log_query_block_range : u64 ,
102102 /// Test mode: skip sending `L1Notification::Synced` events.
103+ #[ cfg( feature = "test-utils" ) ]
103104 test_mode_skip_synced_notification : bool ,
104105}
105106
@@ -210,7 +211,7 @@ where
210211 l1_block_startup_info : L1BlockStartupInfo ,
211212 config : Arc < NodeConfig > ,
212213 log_query_block_range : u64 ,
213- test_mode_skip_synced_notification : bool ,
214+ # [ cfg ( feature = "test-utils" ) ] test_mode_skip_synced_notification : bool ,
214215 ) -> ( mpsc:: Sender < Arc < L1Notification > > , mpsc:: Receiver < Arc < L1Notification > > ) {
215216 tracing:: trace!( target: "scroll::watcher" , ?l1_block_startup_info, ?config, "spawning L1 watcher" ) ;
216217
@@ -274,6 +275,7 @@ where
274275 metrics : WatcherMetrics :: default ( ) ,
275276 is_synced : false ,
276277 log_query_block_range,
278+ #[ cfg( feature = "test-utils" ) ]
277279 test_mode_skip_synced_notification,
278280 } ;
279281
@@ -317,7 +319,12 @@ where
317319 } else if self . current_block_number == self . l1_state . head {
318320 // if we have synced to the head of the L1, notify the channel and set the
319321 // `is_synced`` flag.
320- if !self . test_mode_skip_synced_notification {
322+ #[ cfg( feature = "test-utils" ) ]
323+ let should_skip = self . test_mode_skip_synced_notification ;
324+ #[ cfg( not( feature = "test-utils" ) ) ]
325+ let should_skip = false ;
326+
327+ if !should_skip {
321328 if let Err ( L1WatcherError :: SendError ( _) ) =
322329 self . notify ( L1Notification :: Synced ) . await
323330 {
@@ -910,6 +917,7 @@ mod tests {
910917 metrics : WatcherMetrics :: default ( ) ,
911918 is_synced : false ,
912919 log_query_block_range : LOG_QUERY_BLOCK_RANGE ,
920+ #[ cfg( feature = "test-utils" ) ]
913921 test_mode_skip_synced_notification : false ,
914922 } ,
915923 rx,
0 commit comments