From 9d3cf1ac67e96a0f95b09aea0486c002f39840ad Mon Sep 17 00:00:00 2001 From: Anton Yemelyanov Date: Wed, 27 Dec 2023 14:19:21 +0200 Subject: [PATCH] cleanup --- core/src/core.rs | 2 -- core/src/modules/account_manager/processor.rs | 2 +- core/src/modules/import.rs | 2 -- core/src/modules/metrics.rs | 2 -- core/src/runtime/services/kaspa/inproc.rs | 7 ------- core/src/utils/format.rs | 2 -- core/src/utils/qr.rs | 7 ++++++- 7 files changed, 7 insertions(+), 17 deletions(-) diff --git a/core/src/core.rs b/core/src/core.rs index b18f326..a5df79b 100644 --- a/core/src/core.rs +++ b/core/src/core.rs @@ -334,7 +334,6 @@ impl eframe::App for Core { /// Called each time the UI needs repainting, which may be many times per second. /// Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`. fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { - // println!("update..."); for event in self.application_events_channel.iter() { if let Err(err) = self.handle_events(event.clone(), ctx, frame) { log_error!("error processing wallet runtime event: {}", err); @@ -858,7 +857,6 @@ impl Core { CoreWallet::Balance { balance, id } => { if let Some(account_collection) = &self.account_collection { if let Some(account) = account_collection.get(&id.into()) { - // println!("*** updating account balance: {}", id); account.update_balance(balance)?; } else { log_error!("unable to find account {}", id); diff --git a/core/src/modules/account_manager/processor.rs b/core/src/modules/account_manager/processor.rs index dd5f2a8..b84f0ed 100644 --- a/core/src/modules/account_manager/processor.rs +++ b/core/src/modules/account_manager/processor.rs @@ -157,7 +157,7 @@ impl<'context> Processor<'context> { } Err(error) => { println!(); - println!("transaction error: {error}"); + println!("Transaction error: {error}"); println!(); self.context.reset_send_state(); self.context.action = Action::Error(Arc::new(error)); diff --git a/core/src/modules/import.rs b/core/src/modules/import.rs index 40b144c..69f87c0 100644 --- a/core/src/modules/import.rs +++ b/core/src/modules/import.rs @@ -215,12 +215,10 @@ impl ModuleT for Import { if let Some(result) = unlock_result.take() { match result { Ok(_) => { - println!("Unlock success"); // self.state = State::Unlock; core.select::(); } Err(err) => { - println!("Unlock error: {}", err); self.state = State::Unlock(Some(err.to_string())); } } diff --git a/core/src/modules/metrics.rs b/core/src/modules/metrics.rs index 0c637cc..f320629 100644 --- a/core/src/modules/metrics.rs +++ b/core/src/modules/metrics.rs @@ -189,8 +189,6 @@ impl ModuleT for Metrics { || graph_range_from != core.settings.user_interface.metrics.graph_range_from || graph_range_to != core.settings.user_interface.metrics.graph_range_to { - - println!("graph_range_from: {} graph_range_to: {}", graph_range_from, graph_range_to); core.settings.user_interface.metrics.graph_columns = graph_columns; core.settings.user_interface.metrics.graph_height = graph_height; core.settings.user_interface.metrics.graph_range_from = graph_range_from; diff --git a/core/src/runtime/services/kaspa/inproc.rs b/core/src/runtime/services/kaspa/inproc.rs index 1b7114d..13034f9 100644 --- a/core/src/runtime/services/kaspa/inproc.rs +++ b/core/src/runtime/services/kaspa/inproc.rs @@ -32,7 +32,6 @@ impl InProc { impl super::Kaspad for InProc { async fn start(self: Arc, config: Config) -> Result<()> { let args = Args::try_from(config)?; - println!("ARGS: {:#?}", args); let fd_total_budget = fd_budget::limit() - args.rpc_max_clients as i32 @@ -58,21 +57,15 @@ impl super::Kaspad for InProc { async fn stop(self: Arc) -> Result<()> { if let Some(mut inner) = self.inner.lock().unwrap().take() { let (core, thread) = { - println!("*** TAKING RPC CORE SERVICE..."); let rpc_core_service = inner.rpc_core_service.take(); drop(rpc_core_service); - println!("*** RPC CORE SERVICE TAKEN..."); (inner.core, inner.thread) }; - println!("*** SHUTTING DOWN CORE..."); core.shutdown(); drop(core); - println!("*** CORE SHUT DOWN..."); - println!("*** WAITING FOR THREAD TO JOIN..."); thread .join() .map_err(|_| Error::custom("kaspad inproc thread join failure"))?; - println!("*** THREAD JOINED..."); } Ok(()) } diff --git a/core/src/utils/format.rs b/core/src/utils/format.rs index 936a829..20ec461 100644 --- a/core/src/utils/format.rs +++ b/core/src/utils/format.rs @@ -40,7 +40,6 @@ pub fn format_address(address: &Address, range: Option) -> String { format_address_string(address, range) } - pub fn format_partial_string(text: impl Into, range: Option) -> String { let text: String = text.into(); let range = range.unwrap_or(6); @@ -55,7 +54,6 @@ pub fn format_partial_string(text: impl Into, range: Option) -> S } } - /// SOMPI (u64) to KASPA (string) with suffix layout job generator pub fn s2kws_layout_job( enable: bool, diff --git a/core/src/utils/qr.rs b/core/src/utils/qr.rs index 09d6c71..6d9c6b7 100644 --- a/core/src/utils/qr.rs +++ b/core/src/utils/qr.rs @@ -13,7 +13,12 @@ pub fn render_qrcode(text: &str, width: usize, height: usize) -> String { .to_string() } -pub fn render_qrcode_with_version(text: &str, width: usize, height: usize, version : Version) -> String { +pub fn render_qrcode_with_version( + text: &str, + width: usize, + height: usize, + version: Version, +) -> String { let code = QrCode::with_version(text, version, EcLevel::L).unwrap(); code.render::>()