Skip to content

Commit

Permalink
Merge pull request #270 from 0xcregis/269-fix-anychain-kms-judgement-…
Browse files Browse the repository at this point in the history
…of-the-language-of-mnemonic

fix: anychain-kms judgement of the language of the mnemonic
  • Loading branch information
loki-cmu authored Aug 13, 2024
2 parents c680beb + 0a551e4 commit 34d98eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion anychain-kms/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "anychain-kms"
description = "A Rust library providing Key Management Schema for AnyChain. Handles general security and signature algorithms."
version = "0.1.8"
version = "0.1.9"
keywords = ["cryptography", "security", "signature", "algorithm"]

# Workspace inherited keys
Expand Down
4 changes: 3 additions & 1 deletion anychain-kms/src/bip39/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ impl Language {
}

pub fn from_phrase(phrase: &str) -> Option<Self> {
match phrase.split_whitespace().next() {
let mut iter = phrase.split_whitespace();
iter.next(); // skip the first word, which might not be included in the bip32 chinese wordlist.
match iter.next() {
Some(word) => {
if lazy::WORDMAP_ENGLISH.get_bits(word).is_ok() {
Some(Language::English)
Expand Down

0 comments on commit 34d98eb

Please sign in to comment.