laconicd/codec/codec.go
Federico Kunze 4e01da905a
crypto: refactor for stargate (#559)
* changelog

* update changelog

* crypto: refactor for stargate

* fixes

* fix keys

* changelog
2020-10-06 20:57:55 +02:00

32 lines
933 B
Go

package codec
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
cryptocodec "github.com/cosmos/ethermint/crypto/ethsecp256k1"
ethermint "github.com/cosmos/ethermint/types"
)
// MakeCodec registers the necessary types and interfaces for an sdk.App. This
// codec is provided to all the modules the application depends on.
//
// NOTE: This codec will be deprecated in favor of AppCodec once all modules are
// migrated to protobuf.
func MakeCodec(bm module.BasicManager) *codec.Codec {
cdc := codec.New()
bm.RegisterCodec(cdc)
vesting.RegisterCodec(cdc)
sdk.RegisterCodec(cdc)
cryptocodec.RegisterCodec(cdc)
codec.RegisterCrypto(cdc)
ethermint.RegisterCodec(cdc)
keys.RegisterCodec(cdc) // temporary. Used to register keyring.Info
return cdc
}