diff --git a/applications/tari_swarm_daemon/src/process_manager/manager.rs b/applications/tari_swarm_daemon/src/process_manager/manager.rs index 7fb8ee866..f81463bbd 100644 --- a/applications/tari_swarm_daemon/src/process_manager/manager.rs +++ b/applications/tari_swarm_daemon/src/process_manager/manager.rs @@ -17,7 +17,8 @@ use crate::{ executables::ExecutableManager, handle::{ProcessManagerHandle, ProcessManagerRequest}, instances::InstanceManager, - InstanceId, TemplateData, + InstanceId, + TemplateData, }, }; diff --git a/applications/tari_watcher/src/config.rs b/applications/tari_watcher/src/config.rs index 75d08d814..bf65a2c3a 100644 --- a/applications/tari_watcher/src/config.rs +++ b/applications/tari_watcher/src/config.rs @@ -58,10 +58,10 @@ impl Config { if self.base_wallet_grpc_address.is_empty() { v.push("base_wallet_grpc_address"); } - if v.len() > 0 { - Some(v) - } else { + if v.is_empty() { None + } else { + Some(v) } } } diff --git a/applications/tari_watcher/src/main.rs b/applications/tari_watcher/src/main.rs index be0eeee9e..6a15d4baf 100644 --- a/applications/tari_watcher/src/main.rs +++ b/applications/tari_watcher/src/main.rs @@ -1,23 +1,22 @@ // Copyright 2024 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -use crate::manager::ManagerHandle; -use crate::shutdown::exit_signal; -use anyhow::bail; +use std::{ + path::{Path, PathBuf}, + time::SystemTime, +}; + +use anyhow::{anyhow, bail, Context}; use log::*; -use std::path::{Path, PathBuf}; -use std::time::SystemTime; -use tari_shutdown::ShutdownSignal; -use tokio::task; +use tari_shutdown::{Shutdown, ShutdownSignal}; +use tokio::{fs, task}; use crate::{ cli::{Cli, Commands}, config::{get_base_config, Config}, - manager::ProcessManager, + manager::{ManagerHandle, ProcessManager}, + shutdown::exit_signal, }; -use anyhow::{anyhow, Context}; -use tari_shutdown::Shutdown; -use tokio::fs; mod cli; mod config; @@ -62,7 +61,7 @@ async fn main() -> anyhow::Result<()> { // optionally override config values args.apply(&mut cfg); - let _ = start(cfg).await?; + start(cfg).await?; }, } diff --git a/applications/tari_watcher/src/manager.rs b/applications/tari_watcher/src/manager.rs index 56d5ad665..dd488cf56 100644 --- a/applications/tari_watcher/src/manager.rs +++ b/applications/tari_watcher/src/manager.rs @@ -1,15 +1,16 @@ // Copyright 2024 The Tari Project // SPDX-License-Identifier: BSD-3-Clause +use log::*; +use minotari_app_grpc::tari_rpc::{GetActiveValidatorNodesResponse, TipInfoResponse}; +use tari_shutdown::ShutdownSignal; +use tokio::sync::{mpsc, oneshot}; + use crate::{ config::{Config, ExecutableConfig}, forker::Forker, minotari::Minotari, }; -use log::*; -use minotari_app_grpc::tari_rpc::{GetActiveValidatorNodesResponse, TipInfoResponse}; -use tari_shutdown::ShutdownSignal; -use tokio::sync::{mpsc, oneshot}; pub struct ProcessManager { pub validator_config: ExecutableConfig, @@ -46,11 +47,11 @@ impl ProcessManager { match req { ManagerRequest::GetTipInfo { reply } => { let response = self.chain.get_tip_status().await?; - let _ = reply.send(Ok(response)); + drop(reply.send(Ok(response))); } ManagerRequest::GetActiveValidatorNodes { reply } => { let response = self.chain.get_active_validator_nodes().await?; - let _ = reply.send(Ok(response)); + drop(reply.send(Ok(response))); } ManagerRequest::RegisterValidatorNode => { unimplemented!(); diff --git a/applications/tari_watcher/src/minotari.rs b/applications/tari_watcher/src/minotari.rs index de8c7c3fe..49e058395 100644 --- a/applications/tari_watcher/src/minotari.rs +++ b/applications/tari_watcher/src/minotari.rs @@ -2,12 +2,10 @@ // SPDX-License-Identifier: BSD-3-Clause use anyhow::bail; -use minotari_app_grpc::tari_rpc::TipInfoResponse; -use minotari_app_grpc::tari_rpc::{self as grpc, GetActiveValidatorNodesResponse}; +use minotari_app_grpc::tari_rpc::{self as grpc, GetActiveValidatorNodesResponse, TipInfoResponse}; use minotari_node_grpc_client::BaseNodeGrpcClient; use minotari_wallet_grpc_client::WalletGrpcClient; -use tari_common::exit_codes::ExitCode; -use tari_common::exit_codes::ExitError; +use tari_common::exit_codes::{ExitCode, ExitError}; use tonic::transport::Channel; #[derive(Clone)]