Skip to content

Commit 0543024

Browse files
authored
chore(voyager): small tracing patches (#3567)
2 parents 4c2cb15 + fb604fa commit 0543024

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

lib/voyager-message/src/context.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -856,16 +856,16 @@ pub struct LoadedModulesInfo {
856856
pub client_bootstrap: Vec<ClientBootstrapModuleInfo>,
857857
}
858858

859-
#[instrument(skip_all, fields(%name))]
859+
#[instrument(skip_all, fields(%plugin_name))]
860860
async fn plugin_child_process(
861-
name: String,
861+
plugin_name: String,
862862
module_config: PluginConfig,
863863
cancellation_token: CancellationToken,
864864
) {
865-
let client_socket = ModuleRpcClient::make_socket_path(&name);
866-
let server_socket = make_module_rpc_server_socket_path(&name);
865+
let client_socket = ModuleRpcClient::make_socket_path(&plugin_name);
866+
let server_socket = make_module_rpc_server_socket_path(&plugin_name);
867867

868-
info!(%client_socket, %server_socket, "starting plugin {name}");
868+
info!(%client_socket, %server_socket, "starting plugin {plugin_name}");
869869

870870
let mut cmd = tokio::process::Command::new(&module_config.path);
871871
cmd.arg("run");
@@ -886,16 +886,16 @@ async fn plugin_child_process(
886886
.await
887887
}
888888

889-
#[instrument(skip_all, fields(%name))]
889+
#[instrument(skip_all, fields(%module_name))]
890890
async fn module_child_process<Info: Serialize>(
891-
name: String,
891+
module_name: String,
892892
module_config: ModuleConfig<Info>,
893893
cancellation_token: CancellationToken,
894894
) {
895-
let client_socket = ModuleRpcClient::make_socket_path(&name);
896-
let server_socket = make_module_rpc_server_socket_path(&name);
895+
let client_socket = ModuleRpcClient::make_socket_path(&module_name);
896+
let server_socket = make_module_rpc_server_socket_path(&module_name);
897897

898-
info!(%client_socket, %server_socket, "starting module {name}");
898+
info!(%client_socket, %server_socket, "starting module {module_name}");
899899

900900
lazarus_pit(
901901
&module_config.path,
@@ -973,7 +973,7 @@ async fn lazarus_pit(cmd: &Path, args: &[&str], cancellation_token: Cancellation
973973
.code()
974974
.is_some_and(|c| c == INVALID_CONFIG_EXIT_CODE as i32)
975975
{
976-
error!(%id, "invalid config for plugin");
976+
error!(%id, "invalid config for plugin or module");
977977
cancellation_token.cancel();
978978
}
979979
}

voyager/plugins/transaction/cosmos-sdk/src/main.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// #![warn(clippy::unwrap_used)]
2+
13
use std::collections::VecDeque;
24

35
use chain_utils::{
@@ -96,11 +98,9 @@ impl Plugin for Module {
9698
let bech32_prefix = protos::cosmos::auth::v1beta1::query_client::QueryClient::connect(
9799
config.grpc_url.clone(),
98100
)
99-
.await
100-
.unwrap()
101+
.await?
101102
.bech32_prefix(protos::cosmos::auth::v1beta1::Bech32PrefixRequest {})
102-
.await
103-
.unwrap()
103+
.await?
104104
.into_inner()
105105
.bech32_prefix;
106106

@@ -386,8 +386,7 @@ impl Module {
386386
.comtbft_client
387387
.broadcast_tx_sync(&tx_raw_bytes)
388388
.await
389-
.map_err(BroadcastTxCommitError::BroadcastTxSync)
390-
.unwrap();
389+
.map_err(BroadcastTxCommitError::BroadcastTxSync)?;
391390

392391
assert_eq!(tx_hash, response.hash, "tx hash calculated incorrectly");
393392

0 commit comments

Comments
 (0)