mvondracek / PA193_mnemonic_Slytherin

BIP39 Mnemonic Phrase Generator and Verifier
0 stars 3 forks source link

Report invalid hexastring in input seed or entropy as `EX_DATAERR = 65` #52

Closed mvondracek closed 5 years ago

mvondracek commented 5 years ago
string argument   should contain only ASCII characters
Odd-length string
Non-hexadecimal digit found

Is currently reported as UNKNOWN_FAILURE = 1. Would be better to report it as EX_DATAERR = 65 from mnemoniccli.ExitCode.EX_DATAERR.

mvondracek commented 5 years ago

Should wait until #41 gets merged.

mvondracek commented 5 years ago

@lsolodkova could you please take this?

lsolodkova commented 5 years ago

How can we unit-test non-Unicode entropy and seed? As far as I understand, if we generate entropy/seed in getinvalid* function, we later open it in the same mode it was generated and written to file. And we write it (e.g., test_generate_invalid_entropy) in default UTF-8 (or not, since we do not specify the encoding).