howardwu / wagyu

A Rust library for generating cryptocurrency wallets
https://wagyu.dev
Apache License 2.0
615 stars 108 forks source link

`ethereum import-hd` fails with valid mnemonic #274

Open lightclient opened 3 years ago

lightclient commented 3 years ago
$ ./target/release/wagyu ethereum import-hd --mnemonic "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" --derivation "m/44'/60'/0'/0/0/"
Error: MnemonicError(WordlistError(InvalidWord("candy")))

Not sure why this is not working, this is clearly a valid mnemonic.

lightclient commented 3 years ago

Okay if I get rid of all mnemonic processors except the English one, I get a different error Error: DerivationPathError(InvalidChildNumberFormat). If I drop the final slash on the derivation path, it returns the correct address.

Looking more into this, it seems like the or chain of mnemonic processors will only return the error from the last processor. This is definitely not what we want, since we get into issues like this where it isn't clear what the error is.