Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/entropy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use std::fmt;

use bip39::Mnemonic;
use bip39::{rand::rngs::OsRng, Language, Mnemonic};

use crate::config::WALLET_KEYS_SEED_LEN;
use crate::io;
Expand Down Expand Up @@ -128,7 +128,8 @@ impl fmt::Debug for NodeEntropy {
/// [`Node`]: crate::Node
pub fn generate_entropy_mnemonic(word_count: Option<WordCount>) -> Mnemonic {
let word_count = word_count.unwrap_or(WordCount::Words24).word_count();
Mnemonic::generate(word_count).expect("Failed to generate mnemonic")
Mnemonic::generate_in_with(&mut OsRng, Language::English, word_count)
.expect("Failed to generate mnemonic")
}

/// Supported BIP39 mnemonic word counts for entropy generation.
Expand Down
Loading