From 855dbec468fe98ffc6892e632033739a2f941e66 Mon Sep 17 00:00:00 2001 From: aya015757881 <2581015450@qq.com> Date: Tue, 13 Aug 2024 17:32:11 +0800 Subject: [PATCH 1/2] fix: anychain-kms judgement of the language of the mnemonic --- anychain-kms/src/bip39/language.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anychain-kms/src/bip39/language.rs b/anychain-kms/src/bip39/language.rs index b34e11c..9edadd0 100644 --- a/anychain-kms/src/bip39/language.rs +++ b/anychain-kms/src/bip39/language.rs @@ -152,7 +152,9 @@ impl Language { } pub fn from_phrase(phrase: &str) -> Option { - 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) From 0a551e4cbd25046f99a0fbb3092b1f4919c36fce Mon Sep 17 00:00:00 2001 From: aya015757881 <2581015450@qq.com> Date: Tue, 13 Aug 2024 17:33:10 +0800 Subject: [PATCH 2/2] refactor: version update --- Cargo.lock | 2 +- anychain-kms/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 639a23e..fa768f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,7 +240,7 @@ dependencies = [ [[package]] name = "anychain-kms" -version = "0.1.8" +version = "0.1.9" dependencies = [ "anyhow", "bs58 0.4.0", diff --git a/anychain-kms/Cargo.toml b/anychain-kms/Cargo.toml index b4598c9..b74f4e8 100644 --- a/anychain-kms/Cargo.toml +++ b/anychain-kms/Cargo.toml @@ -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