261f86fdf2
* bump sdk version to v0.39.0 candidate * updates * update evm * bump commit * more changes * build * genesis * fix tests * fix tests * bump commit * bump commit * bump commit * add keygen func * bump version to 0.39.0-rc0 * update AnteHandler * fix TxDecoder * lint * fix test * update statedb * changelog * fixes * remove extra files * update make test-import * rename test * bump SDK version to final release * update to 0.39.1-rc1 * fix evm tests * update RPC * minor fixes * update to rc2 * bump to v0.39.1 * fix personal API * fix string type cast ambiguity (#449) * init * fix estimate gas test * minor genesis change * remove comments from unstable commit (stargate release) Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
34 lines
933 B
Go
34 lines
933 B
Go
package crypto
|
|
|
|
import (
|
|
cryptoamino "github.com/tendermint/tendermint/crypto/encoding/amino"
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
|
)
|
|
|
|
// CryptoCodec is the default amino codec used by ethermint
|
|
var CryptoCodec = codec.New()
|
|
|
|
// Amino encoding names
|
|
const (
|
|
PrivKeyAminoName = "ethermint/PrivKeySecp256k1"
|
|
PubKeyAminoName = "ethermint/PubKeySecp256k1"
|
|
)
|
|
|
|
func init() {
|
|
// replace the keyring codec with the ethermint crypto codec to prevent
|
|
// amino panics because of unregistered Priv/PubKey
|
|
keys.CryptoCdc = CryptoCodec
|
|
keys.RegisterCodec(CryptoCodec)
|
|
cryptoamino.RegisterAmino(CryptoCodec)
|
|
RegisterCodec(CryptoCodec)
|
|
}
|
|
|
|
// RegisterCodec registers all the necessary types with amino for the given
|
|
// codec.
|
|
func RegisterCodec(cdc *codec.Codec) {
|
|
cdc.RegisterConcrete(PubKeySecp256k1{}, PubKeyAminoName, nil)
|
|
cdc.RegisterConcrete(PrivKeySecp256k1{}, PrivKeyAminoName, nil)
|
|
}
|