package lib import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/planetmint/planetmint-go/lib/params" ) // MakeEncodingConfig creates a fully configured EncodingConfig for testing func MakeEncodingConfig() params.EncodingConfig { amino := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() marshaler := codec.NewProtoCodec(interfaceRegistry) txConfig := tx.NewTxConfig(marshaler, tx.DefaultSignModes) encodingConfig := params.EncodingConfig{ InterfaceRegistry: interfaceRegistry, Marshaler: marshaler, TxConfig: txConfig, Amino: amino, } std.RegisterLegacyAminoCodec(encodingConfig.Amino) std.RegisterInterfaces(encodingConfig.InterfaceRegistry) return encodingConfig }