Skip to content
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

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

winder
Copy link
Contributor

@winder winder commented Mar 8, 2022

Summary

While using the new algokey subcommand I noticed some of the error messages were not correct.

@winder winder self-assigned this Mar 8, 2022
@@ -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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -82,7 +82,7 @@ func init() {
keyregCmd.Flags().BoolVar(&params.offline, "offline", false, "set to bring an account offline")
keyregCmd.Flags().StringVarP(&params.txFile, "outputFile", "o", "", fmt.Sprintf("write signed transaction to this file, or '%s' to write to stdout", stdoutFilenameValue))
keyregCmd.Flags().StringVar(&params.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(&params.addr, "account", "", "account address to bring offline; only specify when taking an account offline from voting in Algorand consensus")
keyregCmd.Flags().StringVar(&params.addr, "account", "", "account to bring offline; only specify when taking an account offline from voting in Algorand consensus")
Copy link
Contributor

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 ).

Copy link
Contributor Author

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.

@winder winder changed the title Algokey: clarify some error messages. Bug-fix: clarify some error messages. Mar 11, 2022
@winder winder added the Bug-Fix label Mar 11, 2022
@winder winder changed the title Bug-fix: clarify some error messages. Algokey: clarify some error messages. Mar 11, 2022
@winder winder requested a review from tsachiherman March 14, 2022 19:36
@winder winder requested review from cce and algorandskiy and removed request for tsachiherman April 11, 2022 14:44
@winder winder requested review from AlgoStephenAkiki and Eric-Warehime and removed request for cce and algorandskiy April 19, 2022 18:57
@winder winder merged commit 9fa2fae into algorand:master Apr 22, 2022
@winder winder deleted the will/fix-algokey-errors branch April 22, 2022 15:00
@winder winder changed the title Algokey: clarify some error messages. Algokey: clarify error messages. Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants