Skip to content

Commit

Permalink
fix feature-gated imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Nov 1, 2024
1 parent a820526 commit a96f16f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 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 sdk/seed-phrase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ sha2 = { workspace = true }
solana-signer = { workspace = true }

[dev-dependencies]
solana-seed-phrase = { path = ".", features = ["dev-context-only-utils"] }
tiny-bip39 = { workspace = true }

[features]
dev-context-only-utils = ["keypair"]
keypair = ["solana-signer/keypair"]

[package.metadata.docs.rs]
Expand Down
10 changes: 4 additions & 6 deletions sdk/seed-phrase/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! Functions for generating keypairs from seed phrases.
use {
hmac::Hmac,
solana_signer::keypair::{keypair_from_seed, Keypair},
std::error,
};
use hmac::Hmac;
#[cfg(feature = "keypair")]
use solana_signer::keypair::{keypair_from_seed, Keypair};

pub fn generate_seed_from_seed_phrase_and_passphrase(
seed_phrase: &str,
Expand All @@ -28,7 +26,7 @@ pub fn generate_seed_from_seed_phrase_and_passphrase(
pub fn keypair_from_seed_phrase_and_passphrase(
seed_phrase: &str,
passphrase: &str,
) -> Result<Keypair, Box<dyn error::Error>> {
) -> Result<Keypair, Box<dyn std::error::Error>> {
keypair_from_seed(&generate_seed_from_seed_phrase_and_passphrase(
seed_phrase,
passphrase,
Expand Down

0 comments on commit a96f16f

Please sign in to comment.