fix: Disply for Error::BadWordCount

This Display description of the BadWordCount variant incorrectly
complained stated that the word count is not a multiple of 6. The
correct criteria for valid word counts is now that it must be a multiple
of 3 between 12 and 24 inclusive, so the Display impl is fixed to be
more precise.
This commit is contained in:
pezcore 2023-01-28 16:21:43 -05:00
parent 03dbb973cb
commit 593f4767f4
1 changed files with 6 additions and 1 deletions

View File

@ -120,7 +120,12 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self { match *self {
Error::BadWordCount(c) => { Error::BadWordCount(c) => {
write!(f, "mnemonic has a word count that is not a multiple of 6: {}", c,) write!(
f,
"mnemonic has an invalid word count: {}. Word count must be 12, 15, 18, 21, \
or 24",
c
)
} }
Error::UnknownWord(i) => write!(f, "mnemonic contains an unknown word (word {})", i,), Error::UnknownWord(i) => write!(f, "mnemonic contains an unknown word (word {})", i,),
Error::BadEntropyBitCount(c) => write!( Error::BadEntropyBitCount(c) => write!(