Replace tmcrypto.PubKey by our own cryptotypes.PubKey (#7419)
* WIP on removing tm pub/privkey * Fix part of crypto tests * Add PrivKeyLedgerSecp256K1 proto type * Use BasePrivKey for ledger priv key type * Refacto continued * First round * x/staking * Continue porting * x/* done * Make build pass * More conversion * Remove IntoTmPubKey * Fix test * Remove crypto.PubKey in some other places * Revert ledger changes * Fix comment * Remove useless function * Add To/FromTmPublicKey * Add migrate tests * Fix test * Fix another test * Rename tm conversion functions * Less code * Rename BasePrivKey to LedgerPrivKey * Add changelog * Rename functions Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com>
This commit is contained in:
co-authored by
Amaury Martiny
Alessio Treglia
parent
e172a08333
commit
90e9370bd8
@@ -8,10 +8,10 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
@@ -34,7 +34,7 @@ func Cmd() *cobra.Command {
|
||||
// getPubKeyFromString returns a Tendermint PubKey (PubKeyEd25519) by attempting
|
||||
// to decode the pubkey string from hex, base64, and finally bech32. If all
|
||||
// encodings fail, an error is returned.
|
||||
func getPubKeyFromString(pkstr string) (crypto.PubKey, error) {
|
||||
func getPubKeyFromString(pkstr string) (cryptotypes.PubKey, error) {
|
||||
bz, err := hex.DecodeString(pkstr)
|
||||
if err == nil {
|
||||
if len(bz) == ed25519.PubKeySize {
|
||||
|
||||
Reference in New Issue
Block a user