Skip to content

Commit

Permalink
chore: obscure grpc error response
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Apr 4, 2022
1 parent bbd4c2c commit 21ea1e6
Show file tree
Hide file tree
Showing 4 changed files with 332 additions and 89 deletions.
9 changes: 9 additions & 0 deletions applications/tari_base_node/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub struct BaseNodeContext {
base_node_comms: CommsNode,
base_node_dht: Dht,
base_node_handles: ServiceHandles,
obscure_grpc_error: bool,
}

impl BaseNodeContext {
Expand Down Expand Up @@ -151,6 +152,10 @@ impl BaseNodeContext {
.expect_handle::<StateMachineHandle>()
.get_status_info_watch()
}

pub fn get_obscure_grpc_error(&self) -> bool {
self.obscure_grpc_error
}
}

/// Sets up and initializes the base node, creating the context and database
Expand All @@ -166,6 +171,7 @@ pub async fn configure_and_initialize_node(
node_identity: Arc<NodeIdentity>,
interrupt_signal: ShutdownSignal,
cleanup_orphans_at_startup: bool,
obscure_grpc_error: bool,
) -> Result<BaseNodeContext, anyhow::Error> {
let result = match &config.db_type {
DatabaseType::Memory => {
Expand All @@ -189,6 +195,7 @@ pub async fn configure_and_initialize_node(
config,
interrupt_signal,
cleanup_orphans_at_startup,
obscure_grpc_error,
)
.await?
},
Expand All @@ -213,6 +220,7 @@ async fn build_node_context(
config: Arc<GlobalConfig>,
interrupt_signal: ShutdownSignal,
cleanup_orphans_at_startup: bool,
obscure_grpc_error: bool,
) -> Result<BaseNodeContext, anyhow::Error> {
//---------------------------------- Blockchain --------------------------------------------//
debug!(
Expand Down Expand Up @@ -281,5 +289,6 @@ async fn build_node_context(
base_node_comms,
base_node_dht,
base_node_handles,
obscure_grpc_error,
})
}
Loading

0 comments on commit 21ea1e6

Please sign in to comment.