Expose address in keyinfo, add get command

This commit is contained in:
Ethan Frey
2017-02-28 20:07:44 +01:00
parent d5931c9ee3
commit c59e2d7d13
11 changed files with 89 additions and 17 deletions

View File

@ -4,12 +4,21 @@ import (
"sort"
crypto "github.com/tendermint/go-crypto"
data "github.com/tendermint/go-data"
)
// Info is the public information about a key
type Info struct {
Name string
PubKey crypto.PubKeyS
Name string `json:"name"`
Address data.Bytes `json:"address"`
PubKey crypto.PubKeyS `json:"pubkey"`
}
func (i *Info) Format() Info {
if !i.PubKey.Empty() {
i.Address = i.PubKey.Address()
}
return *i
}
// Infos is a wrapper to allows alphabetical sorting of the keys