Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simapp: rename MakeEncodingConfig to MakeTestEncodingConfig #7681

Merged
merged 3 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* `Validator` update. Methods changed in `ValidatorI` (as described above) and `ToTmValidator` return error.
* `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`.
* `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`.
* Deprecating and renaming `MakeEncodingConfig` to `MakeTestEncodingConfig` (both in `simapp` and `simapp/params` packages).

### Features

Expand Down
2 changes: 1 addition & 1 deletion baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

func TestMsgService(t *testing.T) {
priv, _, _ := testdata.KeyTestPubAddr()
encCfg := simapp.MakeEncodingConfig()
encCfg := simapp.MakeTestEncodingConfig()
db := dbm.NewMemDB()
app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder())
app.SetInterfaceRegistry(encCfg.InterfaceRegistry)
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/simulate/simulate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
app.BankKeeper.SetParams(sdkCtx, banktypes.DefaultParams())

// Set up TxConfig.
encodingConfig := simapp.MakeEncodingConfig()
encodingConfig := simapp.MakeTestEncodingConfig()
clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig)

// Create new simulation server.
Expand Down
2 changes: 1 addition & 1 deletion client/tx/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type TestSuite struct {
}

func (s *TestSuite) SetupSuite() {
encCfg := simapp.MakeEncodingConfig()
encCfg := simapp.MakeTestEncodingConfig()
s.encCfg = encCfg
s.protoCfg = tx.NewTxConfig(codec.NewProtoCodec(encCfg.InterfaceRegistry), tx.DefaultSignModes)
s.aminoCfg = legacytx.StdTxConfig{Cdc: encCfg.Amino}
Expand Down
2 changes: 1 addition & 1 deletion client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

func NewTestTxConfig() client.TxConfig {
cfg := simapp.MakeEncodingConfig()
cfg := simapp.MakeTestEncodingConfig()
return cfg.TxConfig
}

Expand Down
2 changes: 1 addition & 1 deletion server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
},
}

encodingConfig = simapp.MakeEncodingConfig()
encodingConfig = simapp.MakeTestEncodingConfig()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea how we should update this README file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seams that the MakeTestEncodingConfig is needed to users who want to use cli.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it shouldn't be. Not sure why this is here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That example code needs to be rewritten to not use EncodingConfig

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it shouldn't be. Not sure why this is here.

Another point that this task is useful ;)

initClientCtx = client.Context{}.
WithJSONMarshaler(encodingConfig.Marshaler).
WithTxConfig(encodingConfig.TxConfig).
Expand Down
4 changes: 2 additions & 2 deletions server/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t

logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
db := dbm.NewMemDB()
encCfg := simapp.MakeEncodingConfig()
encCfg := simapp.MakeTestEncodingConfig()
app := simapp.NewSimApp(logger, db, nil, true, map[int64]bool{}, tempDir, 0, encCfg)

serverCtx := server.NewDefaultContext()
Expand All @@ -149,7 +149,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t

cmd := server.ExportCmd(
func(_ log.Logger, _ dbm.DB, _ io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string) (types.ExportedApp, error) {
encCfg := simapp.MakeEncodingConfig()
encCfg := simapp.MakeTestEncodingConfig()

var simApp *simapp.SimApp
if height != -1 {
Expand Down
2 changes: 1 addition & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func NewSimApp(
// simapp. It is useful for tests and clients who do not want to construct the
// full simapp
func MakeCodecs() (codec.Marshaler, *codec.LegacyAmino) {
config := MakeEncodingConfig()
config := MakeTestEncodingConfig()
Copy link
Contributor

@amaury1093 amaury1093 Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config := MakeTestEncodingConfig()
config := simappparams.MakeEncodingConfig()
std.RegisterLegacyAminoCodec(config.Amino)
std.RegisterInterfaces(config.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(config.Amino)
ModuleBasics.RegisterInterfaces(config.InterfaceRegistry)

How about:

  1. Move simapp/encoding.go to testutil/encoding.go (That's where it really belongs)
  2. Make the above change (as per simapp: rename MakeEncodingConfig to MakeTestEncodingConfig #7681 (comment), "Apps should just create a codec and register interfaces as needed.")

Advantages:

  • MakeTestEncodingConfig lives in testutil, which makes sense.
  • For users looking at simapp as a reference implementation, they will do registration directly in NewSimApp as above. This imports MakeEncodingConfig from ./params, which is okay.

Disadvantages:

  • We write twice the registration (once for tests, once for reference). It's only executed once though).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach! 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what we want to do in #7642. This PR, as noted in the description, is a temporal solution for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact what we want to do in #7642 is to hide the MakeTestEncodingConfig in a private method, and use app.AppCodecs outside.

return config.Marshaler, config.Amino
}

Expand Down
6 changes: 3 additions & 3 deletions simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func TestSimAppExport(t *testing.T) {
db := dbm.NewMemDB()
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig())

genesisState := NewDefaultGenesisState()
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
Expand All @@ -30,15 +30,15 @@ func TestSimAppExport(t *testing.T) {
app.Commit()

// Making a new app object with the db, so that initchain hasn't been called
app2 := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())
app2 := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig())
_, err = app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}

// ensure that blocked addresses are properly set in bank keeper
func TestBlockedAddrs(t *testing.T) {
db := dbm.NewMemDB()
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())
app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig())

for acc := range maccPerms {
require.Equal(t, !allowedReceivingModAcc[acc], app.BankKeeper.BlockedAddr(app.AccountKeeper.GetModuleAddress(acc)))
Expand Down
9 changes: 6 additions & 3 deletions simapp/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import (
"github.com/cosmos/cosmos-sdk/std"
)

// MakeEncodingConfig creates an EncodingConfig for testing
func MakeEncodingConfig() simappparams.EncodingConfig {
encodingConfig := simappparams.MakeEncodingConfig()
// MakeTestEncodingConfig creates an EncodingConfig for testing.
// This function should be used only internally (in the SDK).
// App user should'nt create new codecs - use the app.AppCodec instead.
// [DEPRECATED]
func MakeTestEncodingConfig() simappparams.EncodingConfig {
encodingConfig := simappparams.MakeTestEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
Expand Down
2 changes: 1 addition & 1 deletion simapp/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ type GenesisState map[string]json.RawMessage

// NewDefaultGenesisState generates the default state for the application.
func NewDefaultGenesisState() GenesisState {
encCfg := MakeEncodingConfig()
encCfg := MakeTestEncodingConfig()
return ModuleBasics.DefaultGenesis(encCfg.Marshaler)
}
7 changes: 5 additions & 2 deletions simapp/params/amino.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
)

// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration.
func MakeEncodingConfig() EncodingConfig {
// MakeTestEncodingConfig creates an EncodingConfig for an amino based test configuration.
// This function should be used only internally (in the SDK).
// App user should'nt create new codecs - use the app.AppCodec instead.
// [DEPRECATED]
func MakeTestEncodingConfig() EncodingConfig {
cdc := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
marshaler := codec.NewAminoCodec(cdc)
Expand Down
7 changes: 5 additions & 2 deletions simapp/params/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/tx"
)

// MakeEncodingConfig creates an EncodingConfig for a non-amino based test configuration.
func MakeEncodingConfig() EncodingConfig {
// MakeTestEncodingConfig creates an EncodingConfig for a non-amino based test configuration.
// This function should be used only internally (in the SDK).
// App user should'nt create new codecs - use the app.AppCodec instead.
// [DEPRECATED]
func MakeTestEncodingConfig() EncodingConfig {
cdc := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
marshaler := codec.NewProtoCodec(interfaceRegistry)
Expand Down
4 changes: 2 additions & 2 deletions simapp/sim_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func BenchmarkFullAppSimulation(b *testing.B) {
}
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), interBlockCacheOpt())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
Expand Down Expand Up @@ -72,7 +72,7 @@ func BenchmarkInvariants(b *testing.B) {
}
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), interBlockCacheOpt())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
Expand Down
12 changes: 6 additions & 6 deletions simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestFullAppSimulation(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// run randomized simulation
Expand Down Expand Up @@ -106,7 +106,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// Run randomized simulation
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", newApp.Name())

var genesisState GenesisState
Expand Down Expand Up @@ -203,7 +203,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(dir))
}()

app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", app.Name())

// Run randomized simulation
Expand Down Expand Up @@ -248,7 +248,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), fauxMerkleModeOpt)
newApp := NewSimApp(log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), fauxMerkleModeOpt)
require.Equal(t, "SimApp", newApp.Name())

newApp.InitChain(abci.RequestInitChain{
Expand Down Expand Up @@ -299,7 +299,7 @@ func TestAppStateDeterminism(t *testing.T) {
}

db := dbm.NewMemDB()
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeEncodingConfig(), interBlockCacheOpt())
app := NewSimApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, FlagPeriodValue, MakeTestEncodingConfig(), interBlockCacheOpt())

fmt.Printf(
"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
Expand Down
6 changes: 3 additions & 3 deletions simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
// NewRootCmd creates a new root command for simd. It is called once in the
// main function.
func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
encodingConfig := simapp.MakeEncodingConfig()
encodingConfig := simapp.MakeTestEncodingConfig()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is hte line being referenced in the documentation at server/README.md. I know that "simapp" in generally is mainly for testing purposes, but it seems strange to call this MakeTestEncodingConfig here, when from what I understand users will mostly be copying a lot of simapp/simd code into their own application when building their own chains.

Perhaps its fine if we have a better strategy for users than looking at simapp/ code when bootstrapping their own app.

@aaronc when you said that we shouldint depend on EncodingConfig at all in the server/README.md, what do you suggest we do here instead? explicitly do all the interface registry stuff here in this function to make it super clear ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MakeTestEncodingConfig is just the wrong name for this function I'd say. What was the rationale in the first place?

Copy link
Member

@aaronc aaronc Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just for switching between amino and protobuf builds.

I don't think simapp is intended to be a reference for apps. The tutorial is for that. Simd was only added during stargate work for testing it was never intended as a reference.

If we want to make simapp a reference for apps we should pull out all the legacy stuff and fully deprecate amino support which will allow EncodingConfig to go away.

Apps should just create a codec and register interfaces as needed. There is a reason why EncodingConfig is in simapp and not part of the SDK proper.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to me, thanks. Yet IMHO the MakeTestEncodingConfig name does not suggest anything like that and MakeEncodingConfig seems still the best name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alessio - please check the referenced issue: #7642

I'm open for a better name suggestions. As stated in this PR, it's a temporal solution to make it clear for the users that they shouldn't use this method.

initClientCtx := client.Context{}.
WithJSONMarshaler(encodingConfig.Marshaler).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
Expand Down Expand Up @@ -191,7 +191,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty
logger, db, traceStore, true, skipUpgradeHeights,
cast.ToString(appOpts.Get(flags.FlagHome)),
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
simapp.MakeEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd.
simapp.MakeTestEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd.
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
Expand All @@ -211,7 +211,7 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty
func createSimappAndExport(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) {
encCfg := simapp.MakeEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd.
encCfg := simapp.MakeTestEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd.
encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry)
var simApp *simapp.SimApp
if height != -1 {
Expand Down
6 changes: 3 additions & 3 deletions simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var DefaultConsensusParams = &abci.ConsensusParams{
// Setup initializes a new SimApp. A Nop logger is set in SimApp.
func Setup(isCheckTx bool) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig())
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeTestEncodingConfig())
if !isCheckTx {
// init chain must be called to stop deliverState from being nil
genesisState := NewDefaultGenesisState()
Expand Down Expand Up @@ -79,7 +79,7 @@ func Setup(isCheckTx bool) *SimApp {
// account. A Nop logger is set in SimApp.
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig())
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeTestEncodingConfig())

genesisState := NewDefaultGenesisState()

Expand Down Expand Up @@ -160,7 +160,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
// accounts and possible balances.
func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig())
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeTestEncodingConfig())

// initialize the chain with the passed in genesis accounts
genesisState := NewDefaultGenesisState()
Expand Down
2 changes: 1 addition & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type Config struct {
// DefaultConfig returns a sane default configuration suitable for nearly all
// testing requirements.
func DefaultConfig() Config {
encCfg := simapp.MakeEncodingConfig()
encCfg := simapp.MakeTestEncodingConfig()

return Config{
Codec: encCfg.Marshaler,
Expand Down
2 changes: 1 addition & 1 deletion types/rest/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func TestParseQueryParamBool(t *testing.T) {
func TestPostProcessResponseBare(t *testing.T) {
t.Parallel()

encodingConfig := simappparams.MakeEncodingConfig()
encodingConfig := simappparams.MakeTestEncodingConfig()
clientCtx := client.Context{}.
WithTxConfig(encodingConfig.TxConfig).
WithLegacyAmino(encodingConfig.Amino) // amino used intentionally here
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) {
suite.ctx = suite.ctx.WithBlockHeight(1)

// Set up TxConfig.
encodingConfig := simapp.MakeEncodingConfig()
encodingConfig := simapp.MakeTestEncodingConfig()
// We're using TestMsg encoding in some tests, so register it here.
encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil)
testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry)
Expand Down
4 changes: 2 additions & 2 deletions x/auth/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ func (s *IntegrationTestSuite) TestGetAccountCmd() {

func TestGetBroadcastCommand_OfflineFlag(t *testing.T) {
clientCtx := client.Context{}.WithOffline(true)
clientCtx = clientCtx.WithTxConfig(simapp.MakeEncodingConfig().TxConfig)
clientCtx = clientCtx.WithTxConfig(simapp.MakeTestEncodingConfig().TxConfig)

cmd := authcli.GetBroadcastCommand()
_ = testutil.ApplyMockIODiscardOutErr(cmd)
Expand All @@ -767,7 +767,7 @@ func TestGetBroadcastCommand_OfflineFlag(t *testing.T) {

func TestGetBroadcastCommand_WithoutOfflineFlag(t *testing.T) {
clientCtx := client.Context{}
txCfg := simapp.MakeEncodingConfig().TxConfig
txCfg := simapp.MakeTestEncodingConfig().TxConfig
clientCtx = clientCtx.WithTxConfig(txCfg)

ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions x/auth/client/cli/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

func TestGetCommandEncode(t *testing.T) {
encodingConfig := simappparams.MakeEncodingConfig()
encodingConfig := simappparams.MakeTestEncodingConfig()

cmd := GetEncodeCommand()
_ = testutil.ApplyMockIODiscardOutErr(cmd)
Expand Down Expand Up @@ -49,7 +49,7 @@ func TestGetCommandEncode(t *testing.T) {
}

func TestGetCommandDecode(t *testing.T) {
encodingConfig := simappparams.MakeEncodingConfig()
encodingConfig := simappparams.MakeTestEncodingConfig()

clientCtx := client.Context{}.
WithTxConfig(encodingConfig.TxConfig).
Expand Down
4 changes: 2 additions & 2 deletions x/auth/client/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestDefaultTxEncoder(t *testing.T) {

func TestReadTxFromFile(t *testing.T) {
t.Parallel()
encodingConfig := simapp.MakeEncodingConfig()
encodingConfig := simapp.MakeTestEncodingConfig()

txCfg := encodingConfig.TxConfig
clientCtx := client.Context{}
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestReadTxFromFile(t *testing.T) {

func TestBatchScanner_Scan(t *testing.T) {
t.Parallel()
encodingConfig := simapp.MakeEncodingConfig()
encodingConfig := simapp.MakeTestEncodingConfig()

txGen := encodingConfig.TxConfig
clientCtx := client.Context{}
Expand Down
2 changes: 1 addition & 1 deletion x/auth/legacy/v040/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func TestMigrate(t *testing.T) {
encodingConfig := simapp.MakeEncodingConfig()
encodingConfig := simapp.MakeTestEncodingConfig()
clientCtx := client.Context{}.
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
WithTxConfig(encodingConfig.TxConfig).
Expand Down
Loading