Skip to content

Commit

Permalink
remove solana-sdk from rpc-client (#3833)
Browse files Browse the repository at this point in the history
* remove solana-sdk from rpc-client

* remove solana-program

* no default features in solana-program dev-dep

* remove solana-sdk from direct dev deps

* sort deps

* fmt

* activate features that were previously implicitly activated
  • Loading branch information
kevinheavey authored Dec 6, 2024
1 parent b3c2274 commit 9d99617
Show file tree
Hide file tree
Showing 8 changed files with 423 additions and 472 deletions.
19 changes: 18 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rpc-client-nonce-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ edition = { workspace = true }

[dependencies]
clap = { version = "2.33.0", optional = true }
solana-account = { workspace = true }
solana-account = { workspace = true, features = ["bincode"] }
solana-clap-utils = { workspace = true, optional = true }
solana-commitment-config = { workspace = true }
solana-hash = { workspace = true }
solana-message = { workspace = true }
solana-nonce = { workspace = true }
solana-nonce = { workspace = true, features = ["serde"] }
solana-pubkey = { workspace = true }
solana-rpc-client = { workspace = true }
solana-sdk-ids = { workspace = true }
Expand Down
19 changes: 18 additions & 1 deletion rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,21 @@ 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, features = ["zstd"] }
solana-clock = { workspace = true }
solana-commitment-config = { workspace = true }
solana-epoch-info = { workspace = true, features = ["serde"] }
solana-epoch-schedule = { workspace = true, features = ["serde"] }
solana-feature-gate-interface = { workspace = true, features = ["serde"] }
solana-hash = { workspace = true }
solana-instruction = { workspace = true }
solana-message = { workspace = true }
solana-pubkey = { workspace = true }
solana-rpc-client-api = { workspace = true }
solana-sdk = { workspace = true }
solana-signature = { workspace = true }
solana-transaction = { workspace = true, features = ["bincode"] }
solana-transaction-error = { workspace = true }
solana-transaction-status-client-types = { workspace = true }
solana-version = { workspace = true }
tokio = { workspace = true, features = ["full"] }
Expand All @@ -36,6 +48,11 @@ futures = { workspace = true }
jsonrpc-core = { workspace = true }
jsonrpc-http-server = { workspace = true }
solana-account-decoder = { workspace = true }
solana-keypair = { workspace = true }
solana-program = { workspace = true, default-features = false }
solana-signer = { workspace = true }
solana-system-transaction = { workspace = true }
static_assertions = { workspace = true }

[features]
default = ["spinner"]
Expand Down
23 changes: 11 additions & 12 deletions rpc-client/src/mock_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ use {
base64::{prelude::BASE64_STANDARD, Engine},
serde_json::{json, Number, Value},
solana_account_decoder_client_types::{UiAccount, UiAccountData, UiAccountEncoding},
solana_clock::{Slot, UnixTimestamp},
solana_epoch_info::EpochInfo,
solana_epoch_schedule::EpochSchedule,
solana_instruction::error::InstructionError,
solana_message::MessageHeader,
solana_pubkey::Pubkey,
solana_rpc_client_api::{
client_error::Result,
config::RpcBlockProductionConfig,
Expand All @@ -19,16 +25,9 @@ use {
RpcVoteAccountStatus,
},
},
solana_sdk::{
clock::{Slot, UnixTimestamp},
epoch_info::EpochInfo,
instruction::InstructionError,
message::MessageHeader,
pubkey::Pubkey,
signature::Signature,
sysvar::epoch_schedule::EpochSchedule,
transaction::{self, Transaction, TransactionError, TransactionVersion},
},
solana_signature::Signature,
solana_transaction::{versioned::TransactionVersion, Transaction},
solana_transaction_error::{TransactionError, TransactionResult},
solana_transaction_status_client_types::{
option_serializer::OptionSerializer, EncodedConfirmedBlock,
EncodedConfirmedTransactionWithStatusMeta, EncodedTransaction,
Expand Down Expand Up @@ -124,7 +123,7 @@ impl RpcSender for MockSender {
transaction_count: Some(123),
})?,
"getSignatureStatuses" => {
let status: transaction::Result<()> = if self.url == "account_in_use" {
let status: TransactionResult<()> = if self.url == "account_in_use" {
Err(TransactionError::AccountInUse)
} else if self.url == "instruction_error" {
Err(TransactionError::InstructionError(
Expand Down Expand Up @@ -455,7 +454,7 @@ pub(crate) fn mock_encoded_account(pubkey: &Pubkey) -> UiAccount {

#[cfg(test)]
mod tests {
use {super::*, solana_account_decoder::encode_ui_account, solana_sdk::account::Account};
use {super::*, solana_account::Account, solana_account_decoder::encode_ui_account};

#[test]
fn test_mock_encoded_account() {
Expand Down
Loading

0 comments on commit 9d99617

Please sign in to comment.