Skip to content

Commit

Permalink
Algokey: clarify error messages. (#3727)
Browse files Browse the repository at this point in the history
  • Loading branch information
winder authored Apr 22, 2022
1 parent a35e609 commit 9fa2fae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/algokey/keyreg.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ func run(params keyregCmdParams) error {
return errors.New("must provide --keyfile when registering participation keys")
}
if params.addr != "" {
return errors.New("do not provide --address when registering participation keys")
return errors.New("do not provide --account when registering participation keys")
}
} else {
if params.addr == "" {
return errors.New("must provide --address when bringing an account offline")
return errors.New("must provide --account when bringing an account offline")
}
if params.partkeyFile != "" {
return errors.New("do not provide --keyfile when bringing an account offline")
Expand All @@ -160,7 +160,7 @@ func run(params keyregCmdParams) error {
var err error
accountAddress, err = basics.UnmarshalChecksumAddress(params.addr)
if err != nil {
return fmt.Errorf("unable to parse --address: %w", err)
return fmt.Errorf("unable to parse --account: %w", err)
}
}

Expand All @@ -172,8 +172,8 @@ func run(params keyregCmdParams) error {
params.txFile = fmt.Sprintf("%s.tx", params.partkeyFile)
}

if util.FileExists(params.txFile) || params.txFile == stdoutFilenameValue {
return fmt.Errorf("outputFile '%s' already exists", params.partkeyFile)
if params.txFile != stdoutFilenameValue && util.FileExists(params.txFile) {
return fmt.Errorf("outputFile '%s' already exists", params.txFile)
}

// Lookup information from partkey file
Expand Down

0 comments on commit 9fa2fae

Please sign in to comment.