diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-22 22:58:00 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-23 18:16:46 +0800 |
commit | 23a5d64fd059bb8bdf02781608a15b8b1bdbdfd2 (patch) | |
tree | 143cd04a9fe002b25c146e7c0b5aacfbe62092eb /cmd/geth | |
parent | 61e6bb12478740d614c8effd330f881f962b7b84 (diff) | |
download | go-tangerine-23a5d64fd059bb8bdf02781608a15b8b1bdbdfd2.tar.gz go-tangerine-23a5d64fd059bb8bdf02781608a15b8b1bdbdfd2.tar.zst go-tangerine-23a5d64fd059bb8bdf02781608a15b8b1bdbdfd2.zip |
accounts, cmd: port packages over to the new logging system
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/accountcmd.go | 4 | ||||
-rw-r--r-- | cmd/geth/accountcmd_test.go | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index b7c411e82..0b0be7938 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -204,11 +204,11 @@ func unlockAccount(ctx *cli.Context, ks *keystore.KeyStore, address string, i in password := getPassPhrase(prompt, false, i, passwords) err = ks.Unlock(account, password) if err == nil { - log.Info(fmt.Sprintf("Unlocked account %x", account.Address)) + log.Info("Unlocked account", "address", account.Address.Hex()) return account, password } if err, ok := err.(*keystore.AmbiguousAddrError); ok { - log.Info(fmt.Sprintf("Unlocked account %x", account.Address)) + log.Info("Unlocked account", "address", account.Address.Hex()) return ambiguousAddrRecovery(ks, err, password), password } if err != keystore.ErrDecrypt { diff --git a/cmd/geth/accountcmd_test.go b/cmd/geth/accountcmd_test.go index 679a7ec30..adcb72454 100644 --- a/cmd/geth/accountcmd_test.go +++ b/cmd/geth/accountcmd_test.go @@ -145,7 +145,8 @@ Passphrase: {{.InputLine "foobar"}} geth.expectExit() wantMessages := []string{ - "Unlocked account f466859ead1932d743d622cb74fc058882e8648a", + "Unlocked account", + "=0xf466859ead1932d743d622cb74fc058882e8648a", } for _, m := range wantMessages { if !strings.Contains(geth.stderrText(), m) { @@ -189,8 +190,9 @@ Passphrase: {{.InputLine "foobar"}} geth.expectExit() wantMessages := []string{ - "Unlocked account 7ef5a6135f1fd6a02593eedc869c6d41d934aef8", - "Unlocked account 289d485d9771714cce91d3393d764e1311907acc", + "Unlocked account", + "=0x7ef5a6135f1fd6a02593eedc869c6d41d934aef8", + "=0x289d485d9771714cce91d3393d764e1311907acc", } for _, m := range wantMessages { if !strings.Contains(geth.stderrText(), m) { @@ -208,8 +210,9 @@ func TestUnlockFlagPasswordFile(t *testing.T) { geth.expectExit() wantMessages := []string{ - "Unlocked account 7ef5a6135f1fd6a02593eedc869c6d41d934aef8", - "Unlocked account 289d485d9771714cce91d3393d764e1311907acc", + "Unlocked account", + "=0x7ef5a6135f1fd6a02593eedc869c6d41d934aef8", + "=0x289d485d9771714cce91d3393d764e1311907acc", } for _, m := range wantMessages { if !strings.Contains(geth.stderrText(), m) { @@ -257,7 +260,8 @@ In order to avoid this warning, you need to remove the following duplicate key f geth.expectExit() wantMessages := []string{ - "Unlocked account f466859ead1932d743d622cb74fc058882e8648a", + "Unlocked account", + "=0xf466859ead1932d743d622cb74fc058882e8648a", } for _, m := range wantMessages { if !strings.Contains(geth.stderrText(), m) { |