From 1ba36a2c05c112e03b914f6f5fb120947f4a6f39 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Mon, 25 Nov 2024 17:19:35 +0400 Subject: [PATCH] remove solana-sdk from rpc-client-api (#3682) * remove solana-sdk from rpc-client-api * update lock file after rebase --- Cargo.lock | 9 ++++++++- programs/sbf/Cargo.lock | 9 ++++++++- rpc-client-api/Cargo.toml | 9 ++++++++- rpc-client-api/src/client_error.rs | 5 ++--- rpc-client-api/src/config.rs | 6 ++---- rpc-client-api/src/custom_error.rs | 4 ++-- rpc-client-api/src/filter.rs | 2 +- rpc-client-api/src/request.rs | 7 ++++--- rpc-client-api/src/response.rs | 10 ++++------ svm/examples/Cargo.lock | 9 ++++++++- 10 files changed, 47 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d45053038f543..aa567249c914cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8246,9 +8246,16 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "solana-account", "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-fee-calculator", + "solana-inflation", "solana-inline-spl", - "solana-sdk", + "solana-pubkey", + "solana-signer", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "thiserror 2.0.3", diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 31ec2d72eccbb9..e1f610bc21e2c2 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6532,9 +6532,16 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "solana-account", "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-fee-calculator", + "solana-inflation", "solana-inline-spl", - "solana-sdk", + "solana-pubkey", + "solana-signer", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "thiserror 2.0.3", diff --git a/rpc-client-api/Cargo.toml b/rpc-client-api/Cargo.toml index e1eee85110178e..0161f6b5dd77ee 100644 --- a/rpc-client-api/Cargo.toml +++ b/rpc-client-api/Cargo.toml @@ -20,9 +20,16 @@ semver = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } +solana-account = { workspace = true } solana-account-decoder-client-types = { workspace = true } +solana-clock = { workspace = true } +solana-commitment-config = { workspace = true } +solana-fee-calculator = { workspace = true } +solana-inflation = { workspace = true } solana-inline-spl = { workspace = true } -solana-sdk = { workspace = true } +solana-pubkey = { workspace = true } +solana-signer = { workspace = true } +solana-transaction-error = { workspace = true } solana-transaction-status-client-types = { workspace = true } solana-version = { workspace = true } thiserror = { workspace = true } diff --git a/rpc-client-api/src/client_error.rs b/rpc-client-api/src/client_error.rs index 05f1bff80cb1fa..e8a7aca9a2a1e2 100644 --- a/rpc-client-api/src/client_error.rs +++ b/rpc-client-api/src/client_error.rs @@ -1,9 +1,8 @@ pub use reqwest; use { crate::{request, response}, - solana_sdk::{ - signature::SignerError, transaction::TransactionError, transport::TransportError, - }, + solana_signer::SignerError, + solana_transaction_error::{TransactionError, TransportError}, std::io, thiserror::Error as ThisError, }; diff --git a/rpc-client-api/src/config.rs b/rpc-client-api/src/config.rs index 57a8c163e400c0..020cd41de01567 100644 --- a/rpc-client-api/src/config.rs +++ b/rpc-client-api/src/config.rs @@ -1,10 +1,8 @@ use { crate::filter::RpcFilterType, solana_account_decoder_client_types::{UiAccountEncoding, UiDataSliceConfig}, - solana_sdk::{ - clock::{Epoch, Slot}, - commitment_config::{CommitmentConfig, CommitmentLevel}, - }, + solana_clock::{Epoch, Slot}, + solana_commitment_config::{CommitmentConfig, CommitmentLevel}, solana_transaction_status_client_types::{TransactionDetails, UiTransactionEncoding}, }; diff --git a/rpc-client-api/src/custom_error.rs b/rpc-client-api/src/custom_error.rs index d1e9c84f15a231..c441c94341cdba 100644 --- a/rpc-client-api/src/custom_error.rs +++ b/rpc-client-api/src/custom_error.rs @@ -2,7 +2,7 @@ use { crate::response::RpcSimulateTransactionResult, jsonrpc_core::{Error, ErrorCode}, - solana_sdk::clock::Slot, + solana_clock::Slot, solana_transaction_status_client_types::EncodeError, thiserror::Error, }; @@ -46,7 +46,7 @@ pub enum RpcCustomError { #[error("NodeUnhealthy")] NodeUnhealthy { num_slots_behind: Option }, #[error("TransactionPrecompileVerificationFailure")] - TransactionPrecompileVerificationFailure(solana_sdk::transaction::TransactionError), + TransactionPrecompileVerificationFailure(solana_transaction_error::TransactionError), #[error("SlotSkipped")] SlotSkipped { slot: Slot }, #[error("NoSnapshot")] diff --git a/rpc-client-api/src/filter.rs b/rpc-client-api/src/filter.rs index 4c65f4249e3aed..b8a78cb7994040 100644 --- a/rpc-client-api/src/filter.rs +++ b/rpc-client-api/src/filter.rs @@ -1,8 +1,8 @@ use { base64::{prelude::BASE64_STANDARD, Engine}, serde::Deserialize, + solana_account::{AccountSharedData, ReadableAccount}, solana_inline_spl::{token::GenericTokenAccount, token_2022::Account}, - solana_sdk::account::{AccountSharedData, ReadableAccount}, std::borrow::Cow, thiserror::Error, }; diff --git a/rpc-client-api/src/request.rs b/rpc-client-api/src/request.rs index fe032a858deb47..647bbb332b1b95 100644 --- a/rpc-client-api/src/request.rs +++ b/rpc-client-api/src/request.rs @@ -1,7 +1,8 @@ use { crate::response::RpcSimulateTransactionResult, serde_json::{json, Value}, - solana_sdk::{clock::Slot, pubkey::Pubkey}, + solana_clock::Slot, + solana_pubkey::Pubkey, std::fmt, thiserror::Error, }; @@ -226,7 +227,7 @@ mod tests { use { super::*, crate::config::RpcTokenAccountsFilter, - solana_sdk::commitment_config::{CommitmentConfig, CommitmentLevel}, + solana_commitment_config::{CommitmentConfig, CommitmentLevel}, }; #[test] @@ -289,7 +290,7 @@ mod tests { // Test request with CommitmentConfig and params let test_request = RpcRequest::GetTokenAccountsByOwner; - let mint = solana_sdk::pubkey::new_rand(); + let mint = solana_pubkey::new_rand(); let token_account_filter = RpcTokenAccountsFilter::Mint(mint.to_string()); let request = test_request .build_request_json(1, json!([addr, token_account_filter, commitment_config])); diff --git a/rpc-client-api/src/response.rs b/rpc-client-api/src/response.rs index c9e6c5e5b99ad9..604ba111023a6b 100644 --- a/rpc-client-api/src/response.rs +++ b/rpc-client-api/src/response.rs @@ -2,12 +2,10 @@ use { crate::client_error, serde::{Deserialize, Deserializer, Serialize, Serializer}, solana_account_decoder_client_types::{token::UiTokenAmount, UiAccount}, - solana_sdk::{ - clock::{Epoch, Slot, UnixTimestamp}, - fee_calculator::{FeeCalculator, FeeRateGovernor}, - inflation::Inflation, - transaction::{Result, TransactionError}, - }, + solana_clock::{Epoch, Slot, UnixTimestamp}, + solana_fee_calculator::{FeeCalculator, FeeRateGovernor}, + solana_inflation::Inflation, + solana_transaction_error::{TransactionError, TransactionResult as Result}, solana_transaction_status_client_types::{ ConfirmedTransactionStatusWithSignature, TransactionConfirmationStatus, UiConfirmedBlock, UiInnerInstructions, UiTransactionReturnData, diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index 345ee5f2f57b65..6a7a36b8e06778 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -6352,9 +6352,16 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "solana-account", "solana-account-decoder-client-types", + "solana-clock", + "solana-commitment-config", + "solana-fee-calculator", + "solana-inflation", "solana-inline-spl", - "solana-sdk", + "solana-pubkey", + "solana-signer", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "thiserror 2.0.3",