From 9e8120ba94589ce7b1cbe0271ff9828c8bd8b6f9 Mon Sep 17 00:00:00 2001 From: kevinheavey Date: Thu, 14 Nov 2024 15:15:04 +0400 Subject: [PATCH] remove solana-sdk from remote-wallet --- Cargo.lock | 5 ++++- programs/sbf/Cargo.lock | 5 ++++- remote-wallet/Cargo.toml | 5 ++++- remote-wallet/src/ledger.rs | 7 ++++--- remote-wallet/src/locator.rs | 2 +- remote-wallet/src/remote_keypair.rs | 7 +++---- remote-wallet/src/remote_wallet.rs | 15 +++++++-------- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 746834653627a3..84755f1fdc3b7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8004,7 +8004,10 @@ dependencies = [ "qstring", "semver 1.0.23", "solana-derivation-path", - "solana-sdk", + "solana-offchain-message", + "solana-pubkey", + "solana-signature", + "solana-signer", "thiserror 1.0.69", "uriparse", ] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 2cf76bffcce4f6..12cddba8fafaf5 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6319,7 +6319,10 @@ dependencies = [ "qstring", "semver", "solana-derivation-path", - "solana-sdk", + "solana-offchain-message", + "solana-pubkey", + "solana-signature", + "solana-signer", "thiserror 1.0.69", "uriparse", ] diff --git a/remote-wallet/Cargo.toml b/remote-wallet/Cargo.toml index bbfc05a221da07..7edeff7ed6aea6 100644 --- a/remote-wallet/Cargo.toml +++ b/remote-wallet/Cargo.toml @@ -20,7 +20,10 @@ parking_lot = { workspace = true } qstring = { workspace = true } semver = { workspace = true } solana-derivation-path = { workspace = true } -solana-sdk = { workspace = true } +solana-offchain-message = { workspace = true } +solana-pubkey = { workspace = true, features = ["std"] } +solana-signature = { workspace = true, features = ["std"] } +solana-signer = { workspace = true } thiserror = { workspace = true } uriparse = { workspace = true } diff --git a/remote-wallet/src/ledger.rs b/remote-wallet/src/ledger.rs index 66d46d752c9cf9..dab0cfe2f97120 100644 --- a/remote-wallet/src/ledger.rs +++ b/remote-wallet/src/ledger.rs @@ -13,7 +13,8 @@ use { crate::{ledger_error::LedgerError, locator::Manufacturer}, log::*, num_traits::FromPrimitive, - solana_sdk::{pubkey::Pubkey, signature::Signature}, + solana_pubkey::Pubkey, + solana_signature::Signature, std::{cmp::min, convert::TryFrom}, }; @@ -526,8 +527,8 @@ impl RemoteWallet for LedgerWallet { message: &[u8], ) -> Result { if message.len() - > solana_sdk::offchain_message::v0::OffchainMessage::MAX_LEN_LEDGER - + solana_sdk::offchain_message::v0::OffchainMessage::HEADER_LEN + > solana_offchain_message::v0::OffchainMessage::MAX_LEN_LEDGER + + solana_offchain_message::v0::OffchainMessage::HEADER_LEN { return Err(RemoteWalletError::InvalidInput( "Off-chain message to sign is too long".to_string(), diff --git a/remote-wallet/src/locator.rs b/remote-wallet/src/locator.rs index 613824990211f6..a54a210a7759bd 100644 --- a/remote-wallet/src/locator.rs +++ b/remote-wallet/src/locator.rs @@ -1,5 +1,5 @@ use { - solana_sdk::pubkey::{ParsePubkeyError, Pubkey}, + solana_pubkey::{ParsePubkeyError, Pubkey}, std::{ convert::{Infallible, TryFrom, TryInto}, str::FromStr, diff --git a/remote-wallet/src/remote_keypair.rs b/remote-wallet/src/remote_keypair.rs index 13f14d03de881b..06e79d05ab2773 100644 --- a/remote-wallet/src/remote_keypair.rs +++ b/remote-wallet/src/remote_keypair.rs @@ -8,10 +8,9 @@ use { }, }, solana_derivation_path::DerivationPath, - solana_sdk::{ - pubkey::Pubkey, - signature::{Signature, Signer, SignerError}, - }, + solana_pubkey::Pubkey, + solana_signature::Signature, + solana_signer::{Signer, SignerError}, }; pub struct RemoteKeypair { diff --git a/remote-wallet/src/remote_wallet.rs b/remote-wallet/src/remote_wallet.rs index 02c739405b1282..3ca8c52406dafb 100644 --- a/remote-wallet/src/remote_wallet.rs +++ b/remote-wallet/src/remote_wallet.rs @@ -9,10 +9,9 @@ use { log::*, parking_lot::RwLock, solana_derivation_path::{DerivationPath, DerivationPathError}, - solana_sdk::{ - pubkey::Pubkey, - signature::{Signature, SignerError}, - }, + solana_pubkey::Pubkey, + solana_signature::Signature, + solana_signer::SignerError, std::{ rc::Rc, time::{Duration, Instant}, @@ -336,7 +335,7 @@ mod tests { #[test] fn test_parse_locator() { - let pubkey = solana_sdk::pubkey::new_rand(); + let pubkey = solana_pubkey::new_rand(); let locator = Locator { manufacturer: Manufacturer::Ledger, pubkey: Some(pubkey), @@ -369,7 +368,7 @@ mod tests { #[test] fn test_remote_wallet_info_matches() { - let pubkey = solana_sdk::pubkey::new_rand(); + let pubkey = solana_pubkey::new_rand(); let info = RemoteWalletInfo { manufacturer: Manufacturer::Ledger, model: "Nano S".to_string(), @@ -391,7 +390,7 @@ mod tests { assert!(info.matches(&test_info)); test_info.host_device_path = "/host/device/path".to_string(); assert!(info.matches(&test_info)); - let another_pubkey = solana_sdk::pubkey::new_rand(); + let another_pubkey = solana_pubkey::new_rand(); test_info.pubkey = another_pubkey; assert!(!info.matches(&test_info)); test_info.pubkey = pubkey; @@ -400,7 +399,7 @@ mod tests { #[test] fn test_get_pretty_path() { - let pubkey = solana_sdk::pubkey::new_rand(); + let pubkey = solana_pubkey::new_rand(); let pubkey_str = pubkey.to_string(); let remote_wallet_info = RemoteWalletInfo { model: "nano-s".to_string(),