mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-09-13 03:40:10 +00:00
30 lines
872 B
Go
30 lines
872 B
Go
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
|
|
}
|