avoid empty wallet seeds (#801)

* fix empty wallet seeds

* mnemonic: return actual error with entropy size on recovering

* seed: extend mnemonic error description

* seed: clarify mnemonic errors

* seed: clarify mnemonic errors, fix missing phrase test

* Clean up seed handling add test

---------

Co-authored-by: ardocrat <ardocrat@gri.mw>
(cherry picked from commit 51ce8e2f2a)
This commit is contained in:
wiesche
2026-10-11 00:45:56 +03:00
committed by ardocrat
parent 90d81a856a
commit 50caa5ecc4
5 changed files with 134 additions and 22 deletions
+4 -2
View File
@@ -1726,8 +1726,10 @@ where
/// * `name`: Reserved for future use, use `None` for the time being.
/// * `mnemonic`: If present, restore the wallet seed from the given mnemonic instead of creating
/// a new random seed.
/// * `mnemonic_length`: Desired length of mnemonic in bytes (16 or 32, either 12 or 24 words).
/// Use 0 if mnemonic isn't being used.
/// * `mnemonic_length`: Entropy length in bytes: 16, 20, 24, 28 or 32
/// (12, 15, 18, 21 or 24 words). Ignored when `mnemonic` is provided.
/// For a new random seed, 0 is also accepted and defaults to 32 bytes.
/// All other values return an error.
/// * `password`: The password used to encrypt/decrypt the `wallet.seed` file
///
/// # Returns