Skip to content

Commit

Permalink
fix error output at privKeyFromLegacyInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbono3 committed Sep 18, 2021
1 parent 9654b4a commit 1b7b8af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crypto/keyring/keyring_ledger_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build ledger test_ledger_mock
//go:build ledger || test_ledger_mock
// +build ledger test_ledger_mock

package keyring

Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/keyring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ func TestRenameKey(t *testing.T) {
newRecord, err := kr.Key(newKeyUID) // new key should be in keyring
require.NoError(t, err)
requireEqualRenamedKey(t, newRecord, oldKeyRecord, false) // oldKeyRecord and newRecord should be the same except name
oldKeyRecord, err = kr.Key(oldKeyUID) // old key should be gone from keyring
oldKeyRecord, err = kr.Key(oldKeyUID) // old key should be gone from keyring
require.Error(t, err)
},
},
Expand Down
3 changes: 1 addition & 2 deletions crypto/keyring/legacy_info.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package keyring

import (
"errors"
"fmt"

"github.com/cosmos/cosmos-sdk/codec/legacy"
Expand Down Expand Up @@ -268,6 +267,6 @@ func privKeyFromLegacyInfo(info LegacyInfo) (cryptotypes.PrivKey, error) {
return priv, nil
// case legacyLedgerInfo, legacyOfflineInfo, LegacyMultiInfo:
default:
return nil, errors.New("only works on local private keys")
return nil, fmt.Errorf("only works on local private keys, provided %s", linfo)
}
}

0 comments on commit 1b7b8af

Please sign in to comment.