Skip to content

Commit 0c2965d

Browse files
authored
remove solana-sdk from some cli modules (#4496)
1 parent 927f4f0 commit 0c2965d

File tree

5 files changed

+73
-44
lines changed

5 files changed

+73
-44
lines changed

Cargo.lock

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

+16
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,30 @@ semver = { workspace = true }
2828
serde = { workspace = true }
2929
serde_derive = { workspace = true }
3030
serde_json = { workspace = true }
31+
solana-account = { workspace = true }
3132
solana-account-decoder = { workspace = true }
3233
solana-bpf-loader-program = { workspace = true }
3334
solana-clap-utils = { workspace = true }
3435
solana-cli-config = { workspace = true }
3536
solana-cli-output = { workspace = true }
3637
solana-client = { workspace = true }
38+
solana-clock = { workspace = true }
3739
solana-commitment-config = { workspace = true }
3840
solana-compute-budget = { workspace = true }
3941
solana-config-program = { workspace = true }
4042
solana-connection-cache = { workspace = true }
4143
solana-decode-error = { workspace = true }
4244
solana-feature-gate-client = { workspace = true }
4345
solana-feature-set = { workspace = true }
46+
solana-hash = { workspace = true }
47+
solana-instruction = { workspace = true }
48+
solana-keypair = { workspace = true }
4449
solana-loader-v4-program = { workspace = true }
4550
solana-logger = { workspace = true }
51+
solana-message = { workspace = true }
52+
solana-native-token = { workspace = true }
53+
solana-offchain-message = { workspace = true }
54+
solana-program = { workspace = true }
4655
solana-program-runtime = { workspace = true }
4756
solana-pubkey = { workspace = true }
4857
solana-pubsub-client = { workspace = true }
@@ -53,9 +62,15 @@ solana-rpc-client-api = { workspace = true }
5362
solana-rpc-client-nonce-utils = { workspace = true, features = ["clap"] }
5463
solana-sbpf = { workspace = true }
5564
solana-sdk = { workspace = true }
65+
solana-sdk-ids = { workspace = true }
66+
solana-signature = { workspace = true }
67+
solana-signer = { workspace = true }
5668
solana-streamer = { workspace = true }
69+
solana-system-interface = { workspace = true, features = ["bincode"] }
5770
solana-tps-client = { workspace = true }
5871
solana-tpu-client = { workspace = true, features = ["default"] }
72+
solana-transaction = { workspace = true }
73+
solana-transaction-error = { workspace = true }
5974
solana-transaction-status = { workspace = true }
6075
solana-udp-client = { workspace = true }
6176
solana-version = { workspace = true }
@@ -67,6 +82,7 @@ tiny-bip39 = { workspace = true }
6782
[dev-dependencies]
6883
assert_matches = { workspace = true }
6984
solana-faucet = { workspace = true }
85+
solana-presigner = { workspace = true }
7086
solana-rpc = { workspace = true }
7187
solana-streamer = { workspace = true }
7288
solana-test-validator = { workspace = true }

cli/src/address_lookup_table.rs

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
use {
22
crate::cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
33
clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
4+
solana_account::from_account,
45
solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
56
solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature},
7+
solana_clock::Clock,
68
solana_commitment_config::CommitmentConfig,
9+
solana_message::Message,
10+
solana_program::address_lookup_table::{
11+
self,
12+
instruction::{
13+
close_lookup_table, create_lookup_table, deactivate_lookup_table, extend_lookup_table,
14+
freeze_lookup_table,
15+
},
16+
state::AddressLookupTable,
17+
},
18+
solana_pubkey::Pubkey,
719
solana_remote_wallet::remote_wallet::RemoteWalletManager,
820
solana_rpc_client::rpc_client::RpcClient,
921
solana_rpc_client_api::config::RpcSendTransactionConfig,
10-
solana_sdk::{
11-
account::from_account,
12-
address_lookup_table::{
13-
self,
14-
instruction::{
15-
close_lookup_table, create_lookup_table, deactivate_lookup_table,
16-
extend_lookup_table, freeze_lookup_table,
17-
},
18-
state::AddressLookupTable,
19-
},
20-
clock::Clock,
21-
message::Message,
22-
pubkey::Pubkey,
23-
signer::Signer,
24-
sysvar,
25-
transaction::Transaction,
26-
},
22+
solana_sdk_ids::sysvar,
23+
solana_signer::Signer,
24+
solana_transaction::Transaction,
2725
std::{rc::Rc, sync::Arc},
2826
};
2927

cli/src/checks.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use {
22
crate::cli::CliError,
33
solana_commitment_config::CommitmentConfig,
4+
solana_message::Message,
5+
solana_native_token::lamports_to_sol,
6+
solana_pubkey::Pubkey,
47
solana_rpc_client::rpc_client::RpcClient,
58
solana_rpc_client_api::client_error::{Error as ClientError, Result as ClientResult},
6-
solana_sdk::{message::Message, native_token::lamports_to_sol, pubkey::Pubkey},
79
};
810

911
pub fn check_account_for_fee(
@@ -176,7 +178,7 @@ mod tests {
176178
request::RpcRequest,
177179
response::{Response, RpcResponseContext},
178180
},
179-
solana_sdk::system_instruction,
181+
solana_system_interface::instruction as system_instruction,
180182
std::collections::HashMap,
181183
};
182184

cli/src/cli.rs

+22-25
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@ use {
1313
display::println_name_value, CliSignature, CliValidatorsSortOrder, OutputFormat,
1414
},
1515
solana_client::connection_cache::ConnectionCache,
16+
solana_clock::{Epoch, Slot},
1617
solana_commitment_config::CommitmentConfig,
1718
solana_decode_error::DecodeError,
19+
solana_hash::Hash,
20+
solana_instruction::error::InstructionError,
21+
solana_keypair::{read_keypair_file, Keypair},
22+
solana_offchain_message::OffchainMessage,
23+
solana_program::stake::{instruction::LockupArgs, state::Lockup},
24+
solana_pubkey::Pubkey,
1825
solana_remote_wallet::remote_wallet::RemoteWalletManager,
1926
solana_rpc_client::rpc_client::RpcClient,
2027
solana_rpc_client_api::{
2128
client_error::{Error as ClientError, Result as ClientResult},
2229
config::{RpcLargestAccountsFilter, RpcSendTransactionConfig, RpcTransactionLogsFilter},
2330
},
2431
solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
25-
solana_sdk::{
26-
clock::{Epoch, Slot},
27-
hash::Hash,
28-
instruction::InstructionError,
29-
offchain_message::OffchainMessage,
30-
pubkey::Pubkey,
31-
signature::{Signature, Signer, SignerError},
32-
signer::keypair::{read_keypair_file, Keypair},
33-
stake::{instruction::LockupArgs, state::Lockup},
34-
transaction::{TransactionError, VersionedTransaction},
35-
},
32+
solana_signature::Signature,
33+
solana_signer::{Signer, SignerError},
3634
solana_tps_client::{utils::create_connection_cache, TpsClient},
3735
solana_tpu_client::tpu_client::{
3836
TpuClient, TpuClientConfig, DEFAULT_TPU_CONNECTION_POOL_SIZE, DEFAULT_TPU_ENABLE_UDP,
3937
},
38+
solana_transaction::versioned::VersionedTransaction,
39+
solana_transaction_error::TransactionError,
4040
solana_vote_program::vote_state::VoteAuthorize,
4141
std::{
4242
collections::HashMap, error, io::stdout, process::exit, rc::Rc, str::FromStr, sync::Arc,
@@ -1789,20 +1789,17 @@ mod tests {
17891789
use {
17901790
super::*,
17911791
serde_json::json,
1792+
solana_keypair::{keypair_from_seed, read_keypair_file, write_keypair_file, Keypair},
1793+
solana_presigner::Presigner,
1794+
solana_pubkey::Pubkey,
17921795
solana_rpc_client::mock_sender_for_cli::SIGNATURE,
17931796
solana_rpc_client_api::{
17941797
request::RpcRequest,
17951798
response::{Response, RpcResponseContext},
17961799
},
17971800
solana_rpc_client_nonce_utils::blockhash_query,
1798-
solana_sdk::{
1799-
pubkey::Pubkey,
1800-
signature::{
1801-
keypair_from_seed, read_keypair_file, write_keypair_file, Keypair, Presigner,
1802-
},
1803-
stake, system_program,
1804-
transaction::TransactionError,
1805-
},
1801+
solana_sdk_ids::{stake, system_program},
1802+
solana_transaction_error::TransactionError,
18061803
solana_transaction_status::TransactionConfirmationStatus,
18071804
};
18081805

@@ -1983,8 +1980,8 @@ mod tests {
19831980
let from_pubkey = solana_pubkey::new_rand();
19841981
let from_str = from_pubkey.to_string();
19851982
for (name, program_id) in &[
1986-
("STAKE", stake::program::id()),
1987-
("VOTE", solana_vote_program::id()),
1983+
("STAKE", stake::id()),
1984+
("VOTE", solana_sdk_ids::vote::id()),
19881985
("NONCE", system_program::id()),
19891986
] {
19901987
let test_create_address_with_seed = test_commands.clone().get_matches_from(vec![
@@ -2016,7 +2013,7 @@ mod tests {
20162013
command: CliCommand::CreateAddressWithSeed {
20172014
from_pubkey: None,
20182015
seed: "seed".to_string(),
2019-
program_id: stake::program::id(),
2016+
program_id: stake::id(),
20202017
},
20212018
signers: vec![Box::new(read_keypair_file(&keypair_file).unwrap())],
20222019
}
@@ -2324,11 +2321,11 @@ mod tests {
23242321
config.command = CliCommand::CreateAddressWithSeed {
23252322
from_pubkey: Some(from_pubkey),
23262323
seed: "seed".to_string(),
2327-
program_id: stake::program::id(),
2324+
program_id: stake::id(),
23282325
};
23292326
let address = process_command(&config);
23302327
let expected_address =
2331-
Pubkey::create_with_seed(&from_pubkey, "seed", &stake::program::id()).unwrap();
2328+
Pubkey::create_with_seed(&from_pubkey, "seed", &stake::id()).unwrap();
23322329
assert_eq!(address.unwrap(), expected_address.to_string());
23332330

23342331
// Need airdrop cases
@@ -2717,7 +2714,7 @@ mod tests {
27172714
memo: None,
27182715
fee_payer: 0,
27192716
derived_address_seed: Some(derived_address_seed),
2720-
derived_address_program_id: Some(stake::program::id()),
2717+
derived_address_program_id: Some(stake::id()),
27212718
compute_unit_price: None,
27222719
},
27232720
signers: vec![Box::new(read_keypair_file(&default_keypair_file).unwrap()),],

0 commit comments

Comments
 (0)