stake-house / wagyu-key-gen

GNU General Public License v3.0
60 stars 42 forks source link

Secret phrase import should trim newline characters #161

Closed yzhuang closed 1 year ago

yzhuang commented 1 year ago

We ran into an issue today and spend a full hour debugging why the Wagyu Key Gen failed to generate a BLS->0x01 change. It turned out that when pasting in the mnemonic secret phrase, the user had a newline character after the last secret word.

A simple trimming operation can help improve user-friendliness.

remyroy commented 1 year ago

It would be a good improvement, indeed. Thanks for the report.

yzhuang commented 1 year ago

@remyroy Apologies for not getting it fully correct on the first attempt. Here's a second attempt: https://github.com/stake-house/wagyu-key-gen/pull/163

I looked at the code more carefully, and mnemonicArray is only used for length validation. It is not passed to the next step: props itself is passed to the next step, so the trimming needs to happen earlier.

Do you mind taking another look?