diff --git a/account/account.go b/account/account.go index c428b72..55b7305 100644 --- a/account/account.go +++ b/account/account.go @@ -128,7 +128,8 @@ func (a *Account) ImportPrivateKey(privateKeyStr string) (*PrivateKeySerialized, return NewPrivateKeySerialized("", privateKey), nil } - return nil, nil + privateKey := hd.Secp256k1.Generate()(priv) + return NewPrivateKeySerialized("", privateKey), nil } func (a *Account) ImportHdPath(mnemonic, hdPath string) (*PrivateKeySerialized, error) { diff --git a/account/pubkey.go b/account/pubkey.go index 3e0430e..8bcb6e5 100755 --- a/account/pubkey.go +++ b/account/pubkey.go @@ -4,25 +4,28 @@ import ( "encoding/hex" "strings" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptoTypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types" - "github.com/evmos/ethermint/crypto/ethsecp256k1" + //"github.com/evmos/ethermint/crypto/ethsecp256k1" ) type PKAccount struct { - publicKey ethsecp256k1.PubKey + //publicKey ethsecp256k1.PubKey //evm + publicKey secp256k1.PubKey } func NewPKAccount(pubkey string) (*PKAccount, error) { pubkey = strings.Split(strings.Split(pubkey, "{")[1], "}")[0] - + key, err := hex.DecodeString(pubkey) if err != nil { return nil, err } return &PKAccount{ - publicKey: ethsecp256k1.PubKey{ + publicKey: secp256k1.PubKey{ + //publicKey: ethsecp256k1.PubKey{ Key: key, }, }, nil