Skip to content

Commit

Permalink
displaying mnmemonic
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Jan 10, 2021
1 parent 5ec838b commit 945b7cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/bm-client/cmd/account_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"strings"

"github.com/bitmaelum/bitmaelum-suite/cmd/bm-client/internal/container"
"github.com/bitmaelum/bitmaelum-suite/internal"
"github.com/bitmaelum/bitmaelum-suite/internal/vault"
"github.com/bitmaelum/bitmaelum-suite/pkg/address"
"github.com/olekukonko/tablewriter"
Expand Down Expand Up @@ -87,6 +88,7 @@ func displayAccount(v *vault.Vault, info vault.AccountInfo) {
table := tablewriter.NewWriter(os.Stdout)
table.SetBorders(tablewriter.Border{Left: false, Top: true, Right: false, Bottom: true})
table.SetCenterSeparator("|")
table.SetColMinWidth(1, 80)

table.AppendBulk([][]string{
{"Account", info.Address.String()},
Expand All @@ -100,14 +102,15 @@ func displayAccount(v *vault.Vault, info vault.AccountInfo) {
})
}

pk := info.GetActiveKey().PubKey
kp := info.GetActiveKey()
table.AppendBulk([][]string{
{"", ""},
{"Full name", info.Name},
{"Routing ID", info.RoutingID},
{"Routing Host", getHostByRoutingID(info.RoutingID, "unknown host")},
{"", ""},
{"Public key", strings.Join(chunks(pk.String(), 78), "\n")},
{"Public key", strings.Join(chunks(kp.PubKey.String(), 118), "\n")},
{"Account mnemonic", internal.GetMnemonic(&kp.KeyPair)},
{"Proof of work", fmt.Sprintf("%d bits", info.Pow.Bits)},
})

Expand Down

0 comments on commit 945b7cf

Please sign in to comment.