Skip to content

Commit

Permalink
Extract derivation-path crate (#2056)
Browse files Browse the repository at this point in the history
* extract derivation-path crate

* remove now unused dep

* update derivation_path dependents

* remove now-unused derivation-path dep
  • Loading branch information
kevinheavey authored Sep 5, 2024
1 parent 4afd4bb commit 1ab8e07
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 23 deletions.
21 changes: 18 additions & 3 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ members = [
"sdk/cargo-test-sbf",
"sdk/clock",
"sdk/decode-error",
"sdk/derivation-path",
"sdk/gen-headers",
"sdk/hash",
"sdk/macro",
Expand Down Expand Up @@ -380,6 +381,7 @@ solana-cost-model = { path = "cost-model", version = "=2.1.0" }
solana-curve25519 = { path = "curves/curve25519", version = "=2.1.0" }
solana-decode-error = { path = "sdk/decode-error", version = "=2.1.0" }
solana-define-syscall = { path = "define-syscall", version = "=2.1.0" }
solana-derivation-path = { path = "sdk/derivation-path", version = "=2.1.0" }
solana-download-utils = { path = "download-utils", version = "=2.1.0" }
solana-entry = { path = "entry", version = "=2.1.0" }
solana-faucet = { path = "faucet", version = "=2.1.0" }
Expand Down
1 change: 1 addition & 0 deletions clap-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ edition = { workspace = true }
chrono = { workspace = true, features = ["default"] }
clap = "2.33.0"
rpassword = { workspace = true }
solana-derivation-path = { workspace = true }
solana-remote-wallet = { workspace = true }
solana-sdk = { workspace = true }
thiserror = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion clap-utils/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ use {
bip39::{Language, Mnemonic, Seed},
clap::ArgMatches,
rpassword::prompt_password,
solana_derivation_path::{DerivationPath, DerivationPathError},
solana_remote_wallet::{
locator::{Locator as RemoteWalletLocator, LocatorError as RemoteWalletLocatorError},
remote_keypair::generate_remote_keypair,
remote_wallet::{maybe_wallet_manager, RemoteWalletError, RemoteWalletManager},
},
solana_sdk::{
derivation_path::{DerivationPath, DerivationPathError},
hash::Hash,
message::Message,
pubkey::Pubkey,
Expand Down
1 change: 1 addition & 0 deletions clap-v3-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ edition = { workspace = true }
chrono = { workspace = true, features = ["default"] }
clap = { version = "3.2.23", features = ["cargo"] }
rpassword = { workspace = true }
solana-derivation-path = { workspace = true }
solana-remote-wallet = { workspace = true }
solana-sdk = { workspace = true }
solana-zk-token-sdk = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion clap-v3-utils/src/input_parsers/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use {
ASK_KEYWORD, SKIP_SEED_PHRASE_VALIDATION_ARG,
},
clap::{builder::ValueParser, ArgMatches},
solana_derivation_path::{DerivationPath, DerivationPathError},
solana_remote_wallet::{
locator::{Locator as RemoteWalletLocator, LocatorError as RemoteWalletLocatorError},
remote_wallet::RemoteWalletManager,
},
solana_sdk::{
derivation_path::{DerivationPath, DerivationPathError},
pubkey::Pubkey,
signature::{read_keypair_file, Keypair, Signature, Signer},
},
Expand Down
2 changes: 1 addition & 1 deletion clap-v3-utils/src/keygen/derivation_path.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
clap::{Arg, ArgMatches},
solana_sdk::derivation_path::DerivationPath,
solana_derivation_path::DerivationPath,
std::error,
};

Expand Down
2 changes: 1 addition & 1 deletion clap-v3-utils/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ use {
bip39::{Language, Mnemonic, Seed},
clap::ArgMatches,
rpassword::prompt_password,
solana_derivation_path::DerivationPath,
solana_remote_wallet::{
remote_keypair::generate_remote_keypair,
remote_wallet::{maybe_wallet_manager, RemoteWalletError, RemoteWalletManager},
},
solana_sdk::{
derivation_path::DerivationPath,
hash::Hash,
message::Message,
pubkey::Pubkey,
Expand Down
1 change: 1 addition & 0 deletions keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dirs-next = { workspace = true }
num_cpus = { workspace = true }
solana-clap-v3-utils = { workspace = true }
solana-cli-config = { workspace = true }
solana-derivation-path = { workspace = true }
solana-remote-wallet = { workspace = true, features = ["default"] }
solana-sdk = { workspace = true }
solana-version = { workspace = true }
Expand Down
18 changes: 15 additions & 3 deletions programs/sbf/Cargo.lock

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

1 change: 1 addition & 0 deletions remote-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ num-traits = { workspace = true }
parking_lot = { workspace = true }
qstring = { workspace = true }
semver = { workspace = true }
solana-derivation-path = { workspace = true }
solana-sdk = { workspace = true }
thiserror = { workspace = true }
uriparse = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion remote-wallet/src/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use {
console::Emoji,
dialoguer::{theme::ColorfulTheme, Select},
semver::Version as FirmwareVersion,
solana_sdk::derivation_path::DerivationPath,
solana_derivation_path::DerivationPath,
std::{fmt, rc::Rc},
};
#[cfg(feature = "hidapi")]
Expand Down
2 changes: 1 addition & 1 deletion remote-wallet/src/remote_keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use {
RemoteWalletType,
},
},
solana_derivation_path::DerivationPath,
solana_sdk::{
derivation_path::DerivationPath,
pubkey::Pubkey,
signature::{Signature, Signer, SignerError},
},
Expand Down
2 changes: 1 addition & 1 deletion remote-wallet/src/remote_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use {
},
log::*,
parking_lot::RwLock,
solana_derivation_path::{DerivationPath, DerivationPathError},
solana_sdk::{
derivation_path::{DerivationPath, DerivationPathError},
pubkey::Pubkey,
signature::{Signature, SignerError},
},
Expand Down
4 changes: 1 addition & 3 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ bytemuck_derive = { workspace = true }
byteorder = { workspace = true, optional = true }
chrono = { workspace = true, features = ["alloc"], optional = true }
curve25519-dalek = { workspace = true, optional = true }
derivation-path = { workspace = true }
digest = { workspace = true, optional = true }
ed25519-dalek = { workspace = true, optional = true }
ed25519-dalek-bip32 = { workspace = true, optional = true }
Expand All @@ -72,7 +71,6 @@ num-derive = { workspace = true }
num-traits = { workspace = true }
num_enum = { workspace = true }
pbkdf2 = { workspace = true }
qstring = { workspace = true }
qualifier_attr = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
rand0-7 = { package = "rand", version = "0.7", optional = true }
Expand All @@ -86,6 +84,7 @@ sha3 = { workspace = true, optional = true }
siphasher = { workspace = true }
solana-bn254 = { workspace = true }
solana-decode-error = { workspace = true }
solana-derivation-path = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }
solana-program = { workspace = true }
Expand All @@ -96,7 +95,6 @@ solana-secp256k1-recover = { workspace = true }
solana-serde-varint = { workspace = true }
solana-short-vec = { workspace = true }
thiserror = { workspace = true }
uriparse = { workspace = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.1", features = ["wasm-bindgen"] }
Expand Down
22 changes: 22 additions & 0 deletions sdk/derivation-path/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "solana-derivation-path"
description = "Solana BIP44 derivation paths."
documentation = "https://docs.rs/solana-derivation-path"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
derivation-path = { workspace = true }
qstring = { workspace = true }
thiserror = { workspace = true }
uriparse = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
File renamed without changes.
3 changes: 2 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ pub mod account_utils;
pub mod client;
pub mod commitment_config;
pub mod compute_budget;
pub mod derivation_path;
pub mod deserialize_utils;
pub mod ed25519_instruction;
pub mod entrypoint;
Expand Down Expand Up @@ -113,6 +112,8 @@ pub mod wasm;
pub use solana_bn254 as alt_bn128;
#[deprecated(since = "2.1.0", note = "Use `solana-decode-error` crate instead")]
pub use solana_decode_error as decode_error;
#[deprecated(since = "2.1.0", note = "Use `solana-derivation-path` crate instead")]
pub use solana_derivation_path as derivation_path;
#[deprecated(since = "2.1.0", note = "Use `solana-program-memory` crate instead")]
pub use solana_program_memory as program_memory;
#[deprecated(since = "2.1.0", note = "Use `solana-sanitize` crate instead")]
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/signer/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use wasm_bindgen::prelude::*;
use {
crate::{
derivation_path::DerivationPath,
pubkey::Pubkey,
signature::Signature,
signer::{EncodableKey, EncodableKeypair, SeedDerivable, Signer, SignerError},
Expand All @@ -13,6 +12,7 @@ use {
ed25519_dalek_bip32::Error as Bip32Error,
hmac::Hmac,
rand0_7::{rngs::OsRng, CryptoRng, RngCore},
solana_derivation_path::DerivationPath,
std::{
error,
io::{Read, Write},
Expand Down
Loading

0 comments on commit 1ab8e07

Please sign in to comment.