Skip to content

Commit

Permalink
remove solana-sdk from some cli modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Jan 17, 2025
1 parent 9ec0980 commit 2f4c6a0
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 44 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

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

16 changes: 16 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,30 @@ semver = { workspace = true }
serde = { workspace = true }
serde_derive = { workspace = true }
serde_json = { workspace = true }
solana-account = { workspace = true }
solana-account-decoder = { workspace = true }
solana-bpf-loader-program = { workspace = true }
solana-clap-utils = { workspace = true }
solana-cli-config = { workspace = true }
solana-cli-output = { workspace = true }
solana-client = { workspace = true }
solana-clock = { workspace = true }
solana-commitment-config = { workspace = true }
solana-compute-budget = { workspace = true }
solana-config-program = { workspace = true }
solana-connection-cache = { workspace = true }
solana-decode-error = { workspace = true }
solana-feature-gate-client = { workspace = true }
solana-feature-set = { workspace = true }
solana-hash = { workspace = true }
solana-instruction = { workspace = true }
solana-keypair = { workspace = true }
solana-loader-v4-program = { workspace = true }
solana-logger = { workspace = true }
solana-message = { workspace = true }
solana-native-token = { workspace = true }
solana-offchain-message = { workspace = true }
solana-program = { workspace = true }
solana-program-runtime = { workspace = true }
solana-pubkey = { workspace = true }
solana-pubsub-client = { workspace = true }
Expand All @@ -53,9 +62,15 @@ solana-rpc-client-api = { workspace = true }
solana-rpc-client-nonce-utils = { workspace = true, features = ["clap"] }
solana-sbpf = { workspace = true }
solana-sdk = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-signature = { workspace = true }
solana-signer = { workspace = true }
solana-streamer = { workspace = true }
solana-system-interface = { workspace = true, features = ["bincode"] }
solana-tps-client = { workspace = true }
solana-tpu-client = { workspace = true, features = ["default"] }
solana-transaction = { workspace = true }
solana-transaction-error = { workspace = true }
solana-transaction-status = { workspace = true }
solana-udp-client = { workspace = true }
solana-version = { workspace = true }
Expand All @@ -67,6 +82,7 @@ tiny-bip39 = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
solana-faucet = { workspace = true }
solana-presigner = { workspace = true }
solana-rpc = { workspace = true }
solana-streamer = { workspace = true }
solana-test-validator = { workspace = true }
Expand Down
32 changes: 15 additions & 17 deletions cli/src/address_lookup_table.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
use {
crate::cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
solana_account::from_account,
solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature},
solana_clock::Clock,
solana_commitment_config::CommitmentConfig,
solana_message::Message,
solana_program::address_lookup_table::{
self,
instruction::{
close_lookup_table, create_lookup_table, deactivate_lookup_table, extend_lookup_table,
freeze_lookup_table,
},
state::AddressLookupTable,
},
solana_pubkey::Pubkey,
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_rpc_client::rpc_client::RpcClient,
solana_rpc_client_api::config::RpcSendTransactionConfig,
solana_sdk::{
account::from_account,
address_lookup_table::{
self,
instruction::{
close_lookup_table, create_lookup_table, deactivate_lookup_table,
extend_lookup_table, freeze_lookup_table,
},
state::AddressLookupTable,
},
clock::Clock,
message::Message,
pubkey::Pubkey,
signer::Signer,
sysvar,
transaction::Transaction,
},
solana_sdk_ids::sysvar,
solana_signer::Signer,
solana_transaction::Transaction,
std::{rc::Rc, sync::Arc},
};

Expand Down
6 changes: 4 additions & 2 deletions cli/src/checks.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use {
crate::cli::CliError,
solana_commitment_config::CommitmentConfig,
solana_message::Message,
solana_native_token::lamports_to_sol,
solana_pubkey::Pubkey,
solana_rpc_client::rpc_client::RpcClient,
solana_rpc_client_api::client_error::{Error as ClientError, Result as ClientResult},
solana_sdk::{message::Message, native_token::lamports_to_sol, pubkey::Pubkey},
};

pub fn check_account_for_fee(
Expand Down Expand Up @@ -176,7 +178,7 @@ mod tests {
request::RpcRequest,
response::{Response, RpcResponseContext},
},
solana_sdk::system_instruction,
solana_system_interface::instruction as system_instruction,
std::collections::HashMap,
};

Expand Down
47 changes: 22 additions & 25 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ use {
display::println_name_value, CliSignature, CliValidatorsSortOrder, OutputFormat,
},
solana_client::connection_cache::ConnectionCache,
solana_clock::{Epoch, Slot},
solana_commitment_config::CommitmentConfig,
solana_decode_error::DecodeError,
solana_hash::Hash,
solana_instruction::error::InstructionError,
solana_keypair::{read_keypair_file, Keypair},
solana_offchain_message::OffchainMessage,
solana_program::stake::{instruction::LockupArgs, state::Lockup},
solana_pubkey::Pubkey,
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_rpc_client::rpc_client::RpcClient,
solana_rpc_client_api::{
client_error::{Error as ClientError, Result as ClientResult},
config::{RpcLargestAccountsFilter, RpcSendTransactionConfig, RpcTransactionLogsFilter},
},
solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
solana_sdk::{
clock::{Epoch, Slot},
hash::Hash,
instruction::InstructionError,
offchain_message::OffchainMessage,
pubkey::Pubkey,
signature::{Signature, Signer, SignerError},
signer::keypair::{read_keypair_file, Keypair},
stake::{instruction::LockupArgs, state::Lockup},
transaction::{TransactionError, VersionedTransaction},
},
solana_signature::Signature,
solana_signer::{Signer, SignerError},
solana_tps_client::{utils::create_connection_cache, TpsClient},
solana_tpu_client::tpu_client::{
TpuClient, TpuClientConfig, DEFAULT_TPU_CONNECTION_POOL_SIZE, DEFAULT_TPU_ENABLE_UDP,
},
solana_transaction::versioned::VersionedTransaction,
solana_transaction_error::TransactionError,
solana_vote_program::vote_state::VoteAuthorize,
std::{
collections::HashMap, error, io::stdout, process::exit, rc::Rc, str::FromStr, sync::Arc,
Expand Down Expand Up @@ -1789,20 +1789,17 @@ mod tests {
use {
super::*,
serde_json::json,
solana_keypair::{keypair_from_seed, read_keypair_file, write_keypair_file, Keypair},
solana_presigner::Presigner,
solana_pubkey::Pubkey,
solana_rpc_client::mock_sender_for_cli::SIGNATURE,
solana_rpc_client_api::{
request::RpcRequest,
response::{Response, RpcResponseContext},
},
solana_rpc_client_nonce_utils::blockhash_query,
solana_sdk::{
pubkey::Pubkey,
signature::{
keypair_from_seed, read_keypair_file, write_keypair_file, Keypair, Presigner,
},
stake, system_program,
transaction::TransactionError,
},
solana_sdk_ids::{stake, system_program},
solana_transaction_error::TransactionError,
solana_transaction_status::TransactionConfirmationStatus,
};

Expand Down Expand Up @@ -1983,8 +1980,8 @@ mod tests {
let from_pubkey = solana_pubkey::new_rand();
let from_str = from_pubkey.to_string();
for (name, program_id) in &[
("STAKE", stake::program::id()),
("VOTE", solana_vote_program::id()),
("STAKE", stake::id()),
("VOTE", solana_sdk_ids::vote::id()),
("NONCE", system_program::id()),
] {
let test_create_address_with_seed = test_commands.clone().get_matches_from(vec![
Expand Down Expand Up @@ -2016,7 +2013,7 @@ mod tests {
command: CliCommand::CreateAddressWithSeed {
from_pubkey: None,
seed: "seed".to_string(),
program_id: stake::program::id(),
program_id: stake::id(),
},
signers: vec![Box::new(read_keypair_file(&keypair_file).unwrap())],
}
Expand Down Expand Up @@ -2324,11 +2321,11 @@ mod tests {
config.command = CliCommand::CreateAddressWithSeed {
from_pubkey: Some(from_pubkey),
seed: "seed".to_string(),
program_id: stake::program::id(),
program_id: stake::id(),
};
let address = process_command(&config);
let expected_address =
Pubkey::create_with_seed(&from_pubkey, "seed", &stake::program::id()).unwrap();
Pubkey::create_with_seed(&from_pubkey, "seed", &stake::id()).unwrap();
assert_eq!(address.unwrap(), expected_address.to_string());

// Need airdrop cases
Expand Down Expand Up @@ -2717,7 +2714,7 @@ mod tests {
memo: None,
fee_payer: 0,
derived_address_seed: Some(derived_address_seed),
derived_address_program_id: Some(stake::program::id()),
derived_address_program_id: Some(stake::id()),
compute_unit_price: None,
},
signers: vec![Box::new(read_keypair_file(&default_keypair_file).unwrap()),],
Expand Down

0 comments on commit 2f4c6a0

Please sign in to comment.