Skip to content

Commit

Permalink
Merge pull request #2577 from oasislabs/kostko/stable/20.1.x/backport…
Browse files Browse the repository at this point in the history
…-2567

go/oasis-node: Include account ID in `stake list -v` cmd
  • Loading branch information
kostko authored Jan 21, 2020
2 parents ddee1cc + d49a6c6 commit 8b625ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/2567.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go/oasis-node: Include account ID in `stake list -v` subcommand.

Changes `stake list -v` subcommand to return a map of IDs to accounts.
16 changes: 9 additions & 7 deletions go/oasis-node/cmd/stake/stake.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ func doList(cmd *cobra.Command, args []string) {
return err
})

for _, v := range ids {
if !cmdFlags.Verbose() {
fmt.Printf("%v\n", v)
continue
if cmdFlags.Verbose() {
accts := make(map[signature.PublicKey]*api.Account)
for _, v := range ids {
accts[v] = getAccountInfo(ctx, cmd, v, client)
}

ai := getAccountInfo(ctx, cmd, v, client)
b, _ := json.Marshal(ai)
b, _ := json.Marshal(accts)
fmt.Printf("%v\n", string(b))
} else {
for _, v := range ids {
fmt.Printf("%v\n", v)
}
}
}

Expand Down

0 comments on commit 8b625ff

Please sign in to comment.