Skip to content

Commit

Permalink
remove solana-sdk from remote-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Dec 9, 2024
1 parent 6c86ce5 commit 43cba90
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 20 deletions.
5 changes: 4 additions & 1 deletion Cargo.lock

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

5 changes: 4 additions & 1 deletion programs/sbf/Cargo.lock

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

5 changes: 4 additions & 1 deletion remote-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
7 changes: 4 additions & 3 deletions remote-wallet/src/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand Down Expand Up @@ -531,8 +532,8 @@ impl RemoteWallet<hidapi::DeviceInfo> for LedgerWallet {
message: &[u8],
) -> Result<Signature, RemoteWalletError> {
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(),
Expand Down
2 changes: 1 addition & 1 deletion remote-wallet/src/locator.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use {
solana_sdk::pubkey::{ParsePubkeyError, Pubkey},
solana_pubkey::{ParsePubkeyError, Pubkey},
std::{
convert::{Infallible, TryFrom, TryInto},
str::FromStr,
Expand Down
7 changes: 3 additions & 4 deletions remote-wallet/src/remote_keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 7 additions & 8 deletions remote-wallet/src/remote_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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(),
Expand All @@ -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;
Expand All @@ -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(),
Expand Down
5 changes: 4 additions & 1 deletion svm/examples/Cargo.lock

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

0 comments on commit 43cba90

Please sign in to comment.