aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonic.rs
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2021-08-21 07:35:13 +0000
committerNicholas Rodrigues Lordello <[email protected]>2021-08-21 07:35:13 +0000
commitf608cce748d80d46f49ba25999e4334fd959b070 (patch)
tree9fc73440b321933cfd6e6ead10ee18d93bc99c89 /src/mnemonic.rs
parentc05487949a5cb9808945b5bdd174e14fdd7e51ea (diff)
Refactor into lib+bin and start adding e2e tests
Diffstat (limited to 'src/mnemonic.rs')
-rw-r--r--src/mnemonic.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mnemonic.rs b/src/mnemonic.rs
index 5121e40..1d553f0 100644
--- a/src/mnemonic.rs
+++ b/src/mnemonic.rs
@@ -59,6 +59,10 @@ impl Mnemonic {
/// Parses a mnemonic from a phrase.
pub fn from_phrase(mnemonic: impl AsRef<str>) -> Result<Self> {
+ Self::from_phrase_str(mnemonic.as_ref())
+ }
+
+ fn from_phrase_str(mnemonic: &str) -> Result<Self> {
let (language, words) = Language::split(mnemonic.as_ref())?;
let len = mnemonic_to_byte_length(words.len())?;