Skip to content

Commit

Permalink
chore: linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
therealdannzor committed Aug 13, 2024
1 parent e146637 commit d2d05e4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use crate::{
executables::ExecutableManager,
handle::{ProcessManagerHandle, ProcessManagerRequest},
instances::InstanceManager,
InstanceId, TemplateData,
InstanceId,
TemplateData,
},
};

Expand Down
6 changes: 3 additions & 3 deletions applications/tari_watcher/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
23 changes: 11 additions & 12 deletions applications/tari_watcher/src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -62,7 +61,7 @@ async fn main() -> anyhow::Result<()> {

// optionally override config values
args.apply(&mut cfg);
let _ = start(cfg).await?;
start(cfg).await?;
},
}

Expand Down
13 changes: 7 additions & 6 deletions applications/tari_watcher/src/manager.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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!();
Expand Down
6 changes: 2 additions & 4 deletions applications/tari_watcher/src/minotari.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit d2d05e4

Please sign in to comment.