Skip to content

Commit

Permalink
dexcctl: remove unnecessary password requirement for togglewalletstatus
Browse files Browse the repository at this point in the history
  • Loading branch information
ukane-philemon committed Sep 28, 2022
1 parent 49df347 commit 3857b85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions client/cmd/dexcctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,17 @@ func main() {
// promptPasswords is a map of routes to password prompts. Passwords are
// prompted in the order given.
var promptPasswords = map[string][]string{
"cancel": {"App password:"},
"discoveracct": {"App password:"},
"init": {"Set new app password:"},
"login": {"App password:"},
"newwallet": {"App password:", "Wallet password:"},
"openwallet": {"App password:"},
"register": {"App password:"},
"trade": {"App password:"},
"withdraw": {"App password:"},
"send": {"App password:"},
"appseed": {"App password:"},
"togglewalletstatus": {"App password:"},
"cancel": {"App password:"},
"discoveracct": {"App password:"},
"init": {"Set new app password:"},
"login": {"App password:"},
"newwallet": {"App password:", "Wallet password:"},
"openwallet": {"App password:"},
"register": {"App password:"},
"trade": {"App password:"},
"withdraw": {"App password:"},
"send": {"App password:"},
"appseed": {"App password:"},
}

// optionalTextFiles is a map of routes to arg index for routes that should read
Expand Down
4 changes: 2 additions & 2 deletions client/rpcserver/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ func checkNArgs(params *RawParams, nPWArgs, nArgs []int) error {
check := func(have int, want []int) error {
if len(want) == 1 {
if want[0] != have {
return fmt.Errorf("%w: wanted %d but got %d", errArgs, want[0], have)
return fmt.Errorf("%w: wanted %d argument but got %d argument", errArgs, want[0], have)
}
} else {
if have < want[0] || have > want[1] {
return fmt.Errorf("%w: wanted between %d and %d but got %d", errArgs, want[0], want[1], have)
return fmt.Errorf("%w: wanted between %d and %d argument but got %d argument", errArgs, want[0], want[1], have)
}
}
return nil
Expand Down

0 comments on commit 3857b85

Please sign in to comment.