Skip to content

Commit

Permalink
accountcmd: return error instead of exit in loadBlsSecretKey (#444)
Browse files Browse the repository at this point in the history
loadBlsSecretKey is called in `account generate-bls-proof` to support loading
BLS secret key from file. But this command also supports loading secret key from
keystore. In that case, no keyfile is given and this function should return
error so the command can handle the error and switch to load secret key from
keystore instead of exit.
  • Loading branch information
minh-bq committed May 13, 2024
1 parent 19ccef8 commit c4d229b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/ronin/accountcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func loadKeyManager(ctx *cli.Context) (*bls.KeyManager, []blsCommon.PublicKey, e

func loadBlsSecretKey(ctx *cli.Context) (blsCommon.SecretKey, error) {
if ctx.Args().Len() != 1 {
utils.Fatalf("keyfile must be given as the only argument")
return nil, fmt.Errorf("keyfile must be given as the only argument")
}
keyfile := ctx.Args().First()
if len(keyfile) == 0 {
Expand Down

0 comments on commit c4d229b

Please sign in to comment.