From bf55c3b41f4f48768a0dfeb16b793ff6c3e7ea90 Mon Sep 17 00:00:00 2001 From: Anton Yemelyanov Date: Sun, 25 Feb 2024 20:39:19 +0200 Subject: [PATCH] Fix WASM32 build --- core/src/modules/settings/mod.rs | 8 ++++++-- core/src/network.rs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/modules/settings/mod.rs b/core/src/modules/settings/mod.rs index 21fb3da..4c86689 100644 --- a/core/src/modules/settings/mod.rs +++ b/core/src/modules/settings/mod.rs @@ -413,8 +413,12 @@ impl Settings { core.settings = self.settings.clone(); core.settings.store_sync().unwrap(); - let storage_root = core.settings.node.kaspad_daemon_storage_folder_enable.then_some(core.settings.node.kaspad_daemon_storage_folder.as_str()); - core.storage.track_storage_root(storage_root); + cfg_if! { + if #[cfg(not(target_arch = "wasm32"))] { + let storage_root = core.settings.node.kaspad_daemon_storage_folder_enable.then_some(core.settings.node.kaspad_daemon_storage_folder.as_str()); + core.storage.track_storage_root(storage_root); + } + } if restart { self.runtime.kaspa_service().update_services(&self.settings.node, None); diff --git a/core/src/network.rs b/core/src/network.rs index 9aba768..57a7c4f 100644 --- a/core/src/network.rs +++ b/core/src/network.rs @@ -20,7 +20,7 @@ pub enum Network { impl std::fmt::Display for Network { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Network::Mainnet => write!(f, "mainnet" ), + Network::Mainnet => write!(f, "mainnet"), Network::Testnet10 => write!(f, "testnet-10"), Network::Testnet11 => write!(f, "testnet-11"), }