@@ -13,7 +13,10 @@ use std::collections::HashMap;
1313use std:: env;
1414use std:: path:: Path ;
1515use std:: sync:: Arc ;
16- use tokio:: sync:: { mpsc, oneshot} ;
16+ use tokio:: sync:: mpsc;
17+
18+ #[ cfg( not( feature = "simulation-mode" ) ) ]
19+ use tokio:: sync:: oneshot;
1720
1821mod eth;
1922mod eth_config_utils;
@@ -319,6 +322,7 @@ async fn main() {
319322
320323 is_eth_provider_config_updated = false ;
321324
325+ #[ cfg( not( feature = "simulation-mode" ) ) ]
322326 if !base_l2_access_source_vector. is_empty ( ) {
323327 // Process in reverse order so the first entry in the vector becomes highest priority
324328 for ( _reverse_index, provider_str) in
@@ -485,33 +489,37 @@ async fn main() {
485489 // Create the cache_sources file with test content
486490 let data_file_path = initfiles_dir. join ( "cache_sources" ) ;
487491
488- // Write cache_source_vector to cache_sources as JSON
489- let cache_json = serde_json:: to_string_pretty ( & cache_source_vector)
490- . expect ( "Failed to serialize cache_source_vector to JSON" ) ;
491- let cache_json_clone = cache_json. clone ( ) ;
492492
493- if let Err ( e) = tokio:: fs:: write ( & data_file_path, cache_json) . await {
494- eprintln ! ( "Warning: Failed to write cache data to file: {}" , e) ;
495- }
493+ #[ cfg( not( feature = "simulation-mode" ) ) ]
494+ {
495+ // Write cache_source_vector to cache_sources as JSON
496+ let cache_json = serde_json:: to_string_pretty ( & cache_source_vector)
497+ . expect ( "Failed to serialize cache_source_vector to JSON" ) ;
498+ let cache_json_clone = cache_json. clone ( ) ;
496499
497- // Create the second directory structure for hns-indexer:sys
498- let hns_indexer_dir = vfs_dir . join ( "hns-indexer:sys" ) ;
499- let hns_initfiles_dir = hns_indexer_dir . join ( "initfiles" ) ;
500+ if let Err ( e ) = tokio :: fs :: write ( & data_file_path , cache_json ) . await {
501+ eprintln ! ( "Warning: Failed to write cache data to file: {}" , e ) ;
502+ }
500503
501- // Create all directories at once for the second location
502- if let Err ( e) = tokio:: fs:: create_dir_all ( & hns_initfiles_dir) . await {
503- eprintln ! (
504- "Failed to create directory structure {}: {}" ,
505- hns_initfiles_dir. display( ) ,
506- e
507- ) ;
508- }
504+ // Create the second directory structure for hns-indexer:sys
505+ let hns_indexer_dir = vfs_dir. join ( "hns-indexer:sys" ) ;
506+ let hns_initfiles_dir = hns_indexer_dir. join ( "initfiles" ) ;
509507
510- // Create the cache_sources file in the second location
511- let hns_data_file_path = hns_initfiles_dir. join ( "cache_sources" ) ;
508+ // Create all directories at once for the second location
509+ if let Err ( e) = tokio:: fs:: create_dir_all ( & hns_initfiles_dir) . await {
510+ eprintln ! (
511+ "Failed to create directory structure {}: {}" ,
512+ hns_initfiles_dir. display( ) ,
513+ e
514+ ) ;
515+ }
512516
513- if let Err ( e) = tokio:: fs:: write ( & hns_data_file_path, cache_json_clone) . await {
514- eprintln ! ( "Warning: Failed to write cache data to second file: {}" , e) ;
517+ // Create the cache_sources file in the second location
518+ let hns_data_file_path = hns_initfiles_dir. join ( "cache_sources" ) ;
519+
520+ if let Err ( e) = tokio:: fs:: write ( & hns_data_file_path, cache_json_clone) . await {
521+ eprintln ! ( "Warning: Failed to write cache data to second file: {}" , e) ;
522+ }
515523 }
516524
517525 let mut tasks = tokio:: task:: JoinSet :: < Result < ( ) > > :: new ( ) ;
0 commit comments