rubixchain / rubixgoplatform

GNU General Public License v3.0
8 stars 17 forks source link

Quick fix : Mnemonic key error handling #174

Closed harirubix closed 3 months ago

harirubix commented 3 months ago

Small fix :

Which we create type 4 DID , we check whether mnemonicFile is present (default -mnemonic.txt) unless specified using -mnemonicKeyFile flag. We had a debug statement Main.Core: failed to read mnemonic file: err="open mnemonic.txt: no such file or directory" which could potentially confuse for users. This PR checks whether specified mnemonickeyfile exist or not and read it only in case it does. If there is no mnenmonickey , we create a random key and store in mnemonic.txt inside DID folder

Testing :

call createdid without specifying mnemonicKeyFile (or a filename that doesn't exist)

Attaching screenshot of code execution before and after.

Screenshot 2024-06-06 at 6 12 02 PM