From 1aaa3ba28abdc14590bc662f5e59c999a93711a6 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Mon, 9 Dec 2024 21:12:35 +0400 Subject: [PATCH] remove solana-sdk from solana-keygen (#4000) --- Cargo.lock | 7 ++++++- keygen/Cargo.toml | 8 +++++++- keygen/src/keygen.rs | 21 ++++++++++----------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b590f8b912393f..805927c1579f52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7360,8 +7360,13 @@ dependencies = [ "solana-clap-v3-utils", "solana-cli-config", "solana-derivation-path", + "solana-instruction", + "solana-keypair", + "solana-message", + "solana-pubkey", "solana-remote-wallet", - "solana-sdk", + "solana-seed-derivable", + "solana-signer", "solana-version", "tempfile", "tiny-bip39", diff --git a/keygen/Cargo.toml b/keygen/Cargo.toml index 93c5e4f2e4f064..311d799027dcdf 100644 --- a/keygen/Cargo.toml +++ b/keygen/Cargo.toml @@ -18,12 +18,18 @@ serde_json = { workspace = true } solana-clap-v3-utils = { workspace = true } solana-cli-config = { workspace = true } solana-derivation-path = { workspace = true } +solana-instruction = { workspace = true } +solana-keypair = { workspace = true } +solana-message = { workspace = true } +solana-pubkey = { workspace = true } solana-remote-wallet = { workspace = true, features = ["default"] } -solana-sdk = { workspace = true } +solana-seed-derivable = { workspace = true } +solana-signer = { workspace = true } solana-version = { workspace = true } tiny-bip39 = { workspace = true } [dev-dependencies] +solana-pubkey = { workspace = true, features = ["rand"] } tempfile = { workspace = true } [[bin]] diff --git a/keygen/src/keygen.rs b/keygen/src/keygen.rs index 6f0b9ff93adc18..1450a13f44d863 100644 --- a/keygen/src/keygen.rs +++ b/keygen/src/keygen.rs @@ -26,16 +26,15 @@ use { DisplayError, }, solana_cli_config::{Config, CONFIG_FILE}, - solana_remote_wallet::remote_wallet::RemoteWalletManager, - solana_sdk::{ - instruction::{AccountMeta, Instruction}, - message::Message, - pubkey::Pubkey, - signature::{ - keypair_from_seed, keypair_from_seed_and_derivation_path, write_keypair, - write_keypair_file, Keypair, Signer, - }, + solana_instruction::{AccountMeta, Instruction}, + solana_keypair::{ + keypair_from_seed, seed_derivable::keypair_from_seed_and_derivation_path, write_keypair, + write_keypair_file, Keypair, }, + solana_message::Message, + solana_pubkey::Pubkey, + solana_remote_wallet::remote_wallet::RemoteWalletManager, + solana_signer::Signer, std::{ collections::HashSet, error, @@ -50,7 +49,7 @@ use { }; mod smallest_length_44_public_key { - use solana_sdk::pubkey::Pubkey; + use solana_pubkey::Pubkey; pub(super) static PUBKEY: Pubkey = Pubkey::from_str_const("21111111111111111111111111111111111111111111"); @@ -1156,7 +1155,7 @@ mod tests { #[test] fn test_read_write_pubkey() -> Result<(), std::boxed::Box> { let filename = "test_pubkey.json"; - let pubkey = solana_sdk::pubkey::new_rand(); + let pubkey = solana_pubkey::new_rand(); write_pubkey_file(filename, pubkey)?; let read = read_pubkey_file(filename)?; assert_eq!(read, pubkey);