From f481ef58e3cc48c1abbfcb8a056f505ef032619d Mon Sep 17 00:00:00 2001 From: brooks Date: Thu, 22 May 2025 15:25:07 -0400 Subject: [PATCH] Uses rpc's client_error::Error::kind() in more places --- client/src/send_and_confirm_transactions_in_parallel.rs | 2 +- rpc-client/src/nonblocking/rpc_client.rs | 2 +- rpc-test/tests/rpc.rs | 2 +- tpu-client/src/nonblocking/tpu_client.rs | 2 +- validator/src/dashboard.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index 6d357180ef6..8e754b5d01b 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -280,7 +280,7 @@ async fn send_transaction_with_rpc_fallback( ) .await { - match &e.kind { + match e.kind() { ErrorKind::Io(_) | ErrorKind::Reqwest(_) => { // fall through on io error, we will retry the transaction } diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs index ed25712c1b9..41c045cba71 100644 --- a/rpc-client/src/nonblocking/rpc_client.rs +++ b/rpc-client/src/nonblocking/rpc_client.rs @@ -993,7 +993,7 @@ impl RpcClient { code, message, data, - }) = &err.kind + }) = err.kind() { debug!("{} {}", code, message); if let RpcResponseErrorData::SendTransactionPreflightFailure( diff --git a/rpc-test/tests/rpc.rs b/rpc-test/tests/rpc.rs index df3e5840dff..5c02280ce71 100644 --- a/rpc-test/tests/rpc.rs +++ b/rpc-test/tests/rpc.rs @@ -570,7 +570,7 @@ fn deserialize_rpc_error() -> ClientResult<()> { let err = rpc_client.send_transaction(&tx); let err = err.unwrap_err(); - match err.kind { + match err.kind() { ClientErrorKind::RpcError(RpcError::RpcRequestError { .. }) => { // This is what used to happen panic!() diff --git a/tpu-client/src/nonblocking/tpu_client.rs b/tpu-client/src/nonblocking/tpu_client.rs index 4e87e46330e..e3b8afbdfc6 100644 --- a/tpu-client/src/nonblocking/tpu_client.rs +++ b/tpu-client/src/nonblocking/tpu_client.rs @@ -1006,7 +1006,7 @@ async fn maybe_fetch_cache_info( fn is_invalid_slot_range_error(client_error: &ClientError) -> bool { if let ErrorKind::RpcError(RpcError::RpcResponseError { code, message, .. }) = - &client_error.kind + client_error.kind() { return *code == -32602 && message.contains("Invalid slot range: leader schedule for epoch"); diff --git a/validator/src/dashboard.rs b/validator/src/dashboard.rs index f59fc1502e1..600b578e5a0 100644 --- a/validator/src/dashboard.rs +++ b/validator/src/dashboard.rs @@ -278,7 +278,7 @@ fn get_validator_stats( request::RpcResponseErrorData::NodeUnhealthy { num_slots_behind: Some(num_slots_behind), }, - }) = &err.kind + }) = err.kind() { format!("{num_slots_behind} slots behind") } else {