crypto: refactor for stargate (#559)

* changelog

* update changelog

* crypto: refactor for stargate

* fixes

* fix keys

* changelog
This commit is contained in:
Federico Kunze
2020-10-06 20:57:55 +02:00
committed by GitHub
parent e7a19a1c0a
commit 4e01da905a
32 changed files with 165 additions and 146 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ import (
"github.com/cosmos/ethermint/app"
ante "github.com/cosmos/ethermint/app/ante"
"github.com/cosmos/ethermint/crypto"
"github.com/cosmos/ethermint/crypto/ethsecp256k1"
ethermint "github.com/cosmos/ethermint/types"
evmtypes "github.com/cosmos/ethermint/x/evm/types"
@@ -60,7 +60,7 @@ func newTestStdFee() auth.StdFee {
// GenerateAddress generates an Ethereum address.
func newTestAddrKey() (sdk.AccAddress, tmcrypto.PrivKey) {
privkey, _ := crypto.GenerateKey()
privkey, _ := ethsecp256k1.GenerateKey()
addr := ethcrypto.PubkeyToAddress(privkey.ToECDSA().PublicKey)
return sdk.AccAddress(addr.Bytes()), privkey
@@ -95,7 +95,7 @@ func newTestEthTx(ctx sdk.Context, msg evmtypes.MsgEthereumTx, priv tmcrypto.Pri
return nil, err
}
privkey, ok := priv.(crypto.PrivKeySecp256k1)
privkey, ok := priv.(ethsecp256k1.PrivKey)
if !ok {
return nil, fmt.Errorf("invalid private key type: %T", priv)
}