diff --git a/kairos-server/src/l1_sync/event_manager.rs b/kairos-server/src/l1_sync/event_manager.rs index d14dd021..fbd188c0 100644 --- a/kairos-server/src/l1_sync/event_manager.rs +++ b/kairos-server/src/l1_sync/event_manager.rs @@ -17,13 +17,11 @@ pub struct EventManager { } impl EventManager { - pub async fn new( - contract_hash: &str, - server_state: Arc, - ) -> Result { + pub async fn new(server_state: Arc) -> Result { tracing::info!("Initializing event manager"); let rpc_url = server_state.server_config.casper_rpc.as_str(); + let contract_hash = server_state.server_config.casper_contract_hash.as_str(); let client = CasperClient::new(rpc_url); let metadata = CesMetadataRef::fetch_metadata(&client, contract_hash).await?; tracing::debug!("Metadata fetched successfully"); diff --git a/kairos-server/src/l1_sync/service.rs b/kairos-server/src/l1_sync/service.rs index f6123352..16a4fd48 100644 --- a/kairos-server/src/l1_sync/service.rs +++ b/kairos-server/src/l1_sync/service.rs @@ -19,11 +19,8 @@ pub struct L1SyncService { } impl L1SyncService { - pub async fn new( - contract_hash: String, - server_state: Arc, - ) -> Result { - let event_manager = EventManager::new(&contract_hash, server_state.clone()).await?; + pub async fn new(server_state: Arc) -> Result { + let event_manager = EventManager::new(server_state.clone()).await?; let (tx, rx) = mpsc::channel(32); let _handle = tokio::spawn(async move { diff --git a/kairos-server/src/lib.rs b/kairos-server/src/lib.rs index 0fee2824..fe714679 100644 --- a/kairos-server/src/lib.rs +++ b/kairos-server/src/lib.rs @@ -52,11 +52,9 @@ pub async fn run_l1_sync(config: ServerConfig, server_state: Arc