Skip to content

Commit

Permalink
remove solana-sdk from solana-clap-utils (#3626)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey authored Nov 15, 2024
1 parent d8cef41 commit 4bc0def
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 36 deletions.
13 changes: 12 additions & 1 deletion Cargo.lock

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

16 changes: 14 additions & 2 deletions clap-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@ edition = { workspace = true }
chrono = { workspace = true, features = ["default"] }
clap = "2.33.0"
rpassword = { workspace = true }
solana-clock = { workspace = true }
solana-cluster-type = { workspace = true }
solana-commitment-config = { workspace = true }
solana-derivation-path = { workspace = true }
solana-remote-wallet = { workspace = true }
solana-sdk = { workspace = true }
solana-hash = { workspace = true }
solana-keypair = { workspace = true, features = ["seed-derivable"] }
solana-native-token = { workspace = true }
solana-presigner = { workspace = true }
solana-program = { workspace = true }
solana-pubkey = { workspace = true }
solana-remote-wallet = { workspace = true, features = ["default"] }
solana-seed-phrase = { workspace = true }
solana-signature = { workspace = true }
solana-signer = { workspace = true }
thiserror = { workspace = true }
tiny-bip39 = { workspace = true }
uriparse = { workspace = true }
url = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
solana-pubkey = { workspace = true, features = ["rand"] }
tempfile = { workspace = true }

[lib]
Expand Down
28 changes: 14 additions & 14 deletions clap-utils/src/input_parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ use {
},
chrono::DateTime,
clap::ArgMatches,
solana_clock::UnixTimestamp,
solana_cluster_type::ClusterType,
solana_commitment_config::CommitmentConfig,
solana_keypair::{read_keypair_file, Keypair},
solana_native_token::sol_to_lamports,
solana_pubkey::Pubkey,
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_sdk::{
clock::UnixTimestamp,
commitment_config::CommitmentConfig,
genesis_config::ClusterType,
native_token::sol_to_lamports,
pubkey::Pubkey,
signature::{read_keypair_file, Keypair, Signature, Signer},
},
solana_signature::Signature,
solana_signer::Signer,
std::{rc::Rc, str::FromStr},
};

Expand Down Expand Up @@ -199,7 +199,7 @@ mod tests {
use {
super::*,
clap::{App, Arg},
solana_sdk::signature::write_keypair_file,
solana_keypair::write_keypair_file,
std::fs,
};

Expand Down Expand Up @@ -228,8 +228,8 @@ mod tests {
assert_eq!(values_of(&matches, "multiple"), Some(vec![50, 39]));
assert_eq!(values_of::<u64>(&matches, "single"), None);

let pubkey0 = solana_sdk::pubkey::new_rand();
let pubkey1 = solana_sdk::pubkey::new_rand();
let pubkey0 = solana_pubkey::new_rand();
let pubkey1 = solana_pubkey::new_rand();
let matches = app().get_matches_from(vec![
"test",
"--multiple",
Expand All @@ -249,7 +249,7 @@ mod tests {
assert_eq!(value_of(&matches, "single"), Some(50));
assert_eq!(value_of::<u64>(&matches, "multiple"), None);

let pubkey = solana_sdk::pubkey::new_rand();
let pubkey = solana_pubkey::new_rand();
let matches = app().get_matches_from(vec!["test", "--single", &pubkey.to_string()]);
assert_eq!(value_of(&matches, "single"), Some(pubkey));
}
Expand Down Expand Up @@ -315,8 +315,8 @@ mod tests {

#[test]
fn test_pubkeys_sigs_of() {
let key1 = solana_sdk::pubkey::new_rand();
let key2 = solana_sdk::pubkey::new_rand();
let key1 = solana_pubkey::new_rand();
let key2 = solana_pubkey::new_rand();
let sig1 = Keypair::new().sign_message(&[0u8]);
let sig2 = Keypair::new().sign_message(&[1u8]);
let signer1 = format!("{key1}={sig1}");
Expand Down
11 changes: 5 additions & 6 deletions clap-utils/src/input_validators.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use {
crate::keypair::{parse_signer_source, SignerSourceKind, ASK_KEYWORD},
chrono::DateTime,
solana_sdk::{
clock::{Epoch, Slot},
hash::Hash,
pubkey::{Pubkey, MAX_SEED_LEN},
signature::{read_keypair_file, Signature},
},
solana_clock::{Epoch, Slot},
solana_hash::Hash,
solana_keypair::read_keypair_file,
solana_pubkey::{Pubkey, MAX_SEED_LEN},
solana_signature::Signature,
std::{fmt::Display, ops::RangeBounds, str::FromStr},
};

Expand Down
26 changes: 14 additions & 12 deletions clap-utils/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ use {
clap::ArgMatches,
rpassword::prompt_password,
solana_derivation_path::{DerivationPath, DerivationPathError},
solana_hash::Hash,
solana_keypair::{
keypair_from_seed, keypair_from_seed_phrase_and_passphrase, read_keypair,
read_keypair_file, seed_derivable::keypair_from_seed_and_derivation_path, Keypair,
},
solana_presigner::Presigner,
solana_program::message::Message,
solana_pubkey::Pubkey,
solana_remote_wallet::{
locator::{Locator as RemoteWalletLocator, LocatorError as RemoteWalletLocatorError},
remote_keypair::generate_remote_keypair,
remote_wallet::{maybe_wallet_manager, RemoteWalletError, RemoteWalletManager},
},
solana_sdk::{
hash::Hash,
message::Message,
pubkey::Pubkey,
signature::{
generate_seed_from_seed_phrase_and_passphrase, keypair_from_seed,
keypair_from_seed_and_derivation_path, keypair_from_seed_phrase_and_passphrase,
read_keypair, read_keypair_file, Keypair, NullSigner, Presigner, Signature, Signer,
},
},
solana_seed_phrase::generate_seed_from_seed_phrase_and_passphrase,
solana_signature::Signature,
solana_signer::{null_signer::NullSigner, Signer},
std::{
cell::RefCell,
convert::TryFrom,
Expand Down Expand Up @@ -207,7 +208,7 @@ impl DefaultSigner {
/// use clap::{App, Arg, value_t_or_exit};
/// use solana_clap_utils::keypair::{DefaultSigner, signer_from_path};
/// use solana_clap_utils::offline::OfflineArgs;
/// use solana_sdk::signer::Signer;
/// use solana_signer::Signer;
///
/// let clap_app = App::new("my-program")
/// // The argument we'll parse as a signer "path"
Expand Down Expand Up @@ -1123,8 +1124,9 @@ mod tests {
crate::offline::OfflineArgs,
assert_matches::assert_matches,
clap::{value_t_or_exit, App, Arg},
solana_keypair::write_keypair_file,
solana_program::system_instruction,
solana_remote_wallet::{locator::Manufacturer, remote_wallet::initialize_wallet_manager},
solana_sdk::{signer::keypair::write_keypair_file, system_instruction},
tempfile::{NamedTempFile, TempDir},
};

Expand Down
27 changes: 26 additions & 1 deletion programs/sbf/Cargo.lock

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

0 comments on commit 4bc0def

Please sign in to comment.