29d3abcf09
* Reuse cosmos-sdk client library to create keyring Extracted from https://github.com/evmos/ethermint/pull/1168 Cleanup cmd code for easier to migration to cosmos-sdk 0.46 * Update cosmos-sdk v0.46 prepare for implementing cosmos-sdk feemarket and tx prioritization changelog refactor cmd use sdkmath fix lint fix unit tests fix unit test genesis fix unit tests fix unit test env setup fix unit tests fix unit tests register PrivKey impl fix extension options fix lint fix unit tests make HandlerOption.Validate private gofumpt fix msg response decoding fix sim test bump cosmos-sdk version fix sim test sdk 46 fix unit test fix unit tests update ibc-go
32 lines
1012 B
Go
32 lines
1012 B
Go
package encoding
|
|
|
|
import (
|
|
amino "github.com/cosmos/cosmos-sdk/codec"
|
|
"github.com/cosmos/cosmos-sdk/codec/types"
|
|
"github.com/cosmos/cosmos-sdk/simapp/params"
|
|
"github.com/cosmos/cosmos-sdk/types/module"
|
|
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
|
|
|
enccodec "github.com/evmos/ethermint/encoding/codec"
|
|
)
|
|
|
|
// MakeConfig creates an EncodingConfig for testing
|
|
func MakeConfig(mb module.BasicManager) params.EncodingConfig {
|
|
cdc := amino.NewLegacyAmino()
|
|
interfaceRegistry := types.NewInterfaceRegistry()
|
|
codec := amino.NewProtoCodec(interfaceRegistry)
|
|
|
|
encodingConfig := params.EncodingConfig{
|
|
InterfaceRegistry: interfaceRegistry,
|
|
Codec: codec,
|
|
TxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes),
|
|
Amino: cdc,
|
|
}
|
|
|
|
enccodec.RegisterLegacyAminoCodec(encodingConfig.Amino)
|
|
mb.RegisterLegacyAminoCodec(encodingConfig.Amino)
|
|
enccodec.RegisterInterfaces(encodingConfig.InterfaceRegistry)
|
|
mb.RegisterInterfaces(encodingConfig.InterfaceRegistry)
|
|
return encodingConfig
|
|
}
|