Skip to content

Commit

Permalink
Format string literals in solana_rpc_client_api (#2769)
Browse files Browse the repository at this point in the history
Format strings
  • Loading branch information
CriesofCarrots authored Aug 28, 2024
1 parent cddcf8b commit e8cc9dc
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions rpc-client-api/src/custom_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ impl From<RpcCustomError> for Error {
} => Self {
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP),
message: format!(
"Block {slot} cleaned up, does not exist on node. First available block: {first_available_block}",
"Block {slot} cleaned up, does not exist on node. First available block: \
{first_available_block}",
),
data: None,
},
Expand Down Expand Up @@ -178,8 +179,8 @@ impl From<RpcCustomError> for Error {
JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX,
),
message: format!(
"{index_key} excluded from account secondary indexes; \
this RPC method unavailable for key"
"{index_key} excluded from account secondary indexes; this RPC method \
unavailable for key"
),
data: None,
},
Expand Down Expand Up @@ -211,8 +212,8 @@ impl From<RpcCustomError> for Error {
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION),
message: format!(
"Transaction version ({version}) is not supported by the requesting client. \
Please try the request again with the following configuration parameter: \
\"maxSupportedTransactionVersion\": {version}"
Please try the request again with the following configuration parameter: \
\"maxSupportedTransactionVersion\": {version}"
),
data: None,
},
Expand All @@ -223,7 +224,11 @@ impl From<RpcCustomError> for Error {
context_slot,
})),
},
RpcCustomError::EpochRewardsPeriodActive { slot, current_block_height, rewards_complete_block_height } => Self {
RpcCustomError::EpochRewardsPeriodActive {
slot,
current_block_height,
rewards_complete_block_height,
} => Self {
code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_EPOCH_REWARDS_PERIOD_ACTIVE),
message: format!("Epoch rewards period still active at slot {slot}"),
data: Some(serde_json::json!(EpochRewardsPeriodActiveErrorData {
Expand Down

0 comments on commit e8cc9dc

Please sign in to comment.