Skip to content

Commit

Permalink
Update default contract hash check.
Browse files Browse the repository at this point in the history
  • Loading branch information
koxu1996 committed Jun 12, 2024
1 parent 3b52fb1 commit 8c5cc97
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions kairos-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ pub fn app_router(state: ServerState) -> Router {
.with_state(state)
}

pub async fn run_l1_sync(config: ServerConfig, server_state: Arc<ServerStateInner>) {
// Make sure real contract hash was provided.
if config.casper_contract_hash
== "0000000000000000000000000000000000000000000000000000000000000000"
{
pub async fn run_l1_sync(server_state: Arc<ServerStateInner>) {
// Extra check: make sure the default dummy value of contract hash was changed.
let contract_hash = server_state.server_config.casper_contract_hash.as_str();
if contract_hash == "0000000000000000000000000000000000000000000000000000000000000000" {
tracing::warn!(
"Casper contract hash not configured, L1 synchronization will NOT be enabled."
);
Expand Down Expand Up @@ -74,7 +73,7 @@ pub async fn run(config: ServerConfig) {
server_config: config.clone(),
});

run_l1_sync(config.clone(), state.clone()).await;
run_l1_sync(state.clone()).await;

let app = app_router(state);

Expand Down

0 comments on commit 8c5cc97

Please sign in to comment.