-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Algokey: clarify error messages. #3727
Conversation
@@ -173,7 +173,7 @@ func run(params keyregCmdParams) error { | |||
} | |||
|
|||
if util.FileExists(params.txFile) || params.txFile == stdoutFilenameValue { | |||
return fmt.Errorf("outputFile '%s' already exists", params.partkeyFile) | |||
return fmt.Errorf("outputFile '%s' already exists", params.txFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message makes sense only for the first case of the conditional. In the second case, you might want to have a separate error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that expression is wrong. It should be verifying that it is not the stdout filename.
cmd/algokey/keyreg.go
Outdated
@@ -82,7 +82,7 @@ func init() { | |||
keyregCmd.Flags().BoolVar(¶ms.offline, "offline", false, "set to bring an account offline") | |||
keyregCmd.Flags().StringVarP(¶ms.txFile, "outputFile", "o", "", fmt.Sprintf("write signed transaction to this file, or '%s' to write to stdout", stdoutFilenameValue)) | |||
keyregCmd.Flags().StringVar(¶ms.partkeyFile, "keyfile", "", "participation keys to register, file is opened to fetch metadata for the transaction; only specify when bringing an account online to vote in Algorand consensus") | |||
keyregCmd.Flags().StringVar(¶ms.addr, "account", "", "account address to bring offline; only specify when taking an account offline from voting in Algorand consensus") | |||
keyregCmd.Flags().StringVar(¶ms.addr, "account", "", "account to bring offline; only specify when taking an account offline from voting in Algorand consensus") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the word "address" should remain since the provided parameter is the address.
Also, you're referring to the operation as both "bring offline" and "taking offline". I think it would be cleaner to align with one of these. ( I think that we're using the term "take offline" more frequently. But I could be wrong here ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add "address" back in. This is the phrasing Noah suggested, I don't feel very strongly about it. It looks like goal doesn't use either of these and is using language like set to bring an account offline
.
Summary
While using the new algokey subcommand I noticed some of the error messages were not correct.