Skip to content

Commit

Permalink
codecs: rename MakeCodecs rename and docs update (cosmos#8245)
Browse files Browse the repository at this point in the history
* codecs: rename MakeCodecs to MakeTestCodecs

* update changelog

* remove MakeTestCodecs

* typo
  • Loading branch information
robert-zaremba authored Jan 7, 2021
1 parent 1a5a573 commit 0b97dee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
9 changes: 0 additions & 9 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ func NewSimApp(
appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp),
) *SimApp {

// TODO: Remove cdc in favor of appCodec once all modules are migrated.
appCodec := encodingConfig.Marshaler
legacyAmino := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
Expand Down Expand Up @@ -441,14 +440,6 @@ func NewSimApp(
return app
}

// MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by
// simapp. It is useful for tests and clients who do not want to construct the
// full simapp
func MakeCodecs() (codec.Marshaler, *codec.LegacyAmino) {
config := MakeTestEncodingConfig()
return config.Marshaler, config.Amino
}

// Name returns the name of the App
func (app *SimApp) Name() string { return app.BaseApp.Name() }

Expand Down
6 changes: 3 additions & 3 deletions encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"github.com/cosmos/cosmos-sdk/std"
)

// 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.
// MakeTestEncodingConfig creates an EncodingConfig for testing. This function
// should be used only in tests or when creating a new app instance (NewApp*()).
// App user shouldn't create new codecs - use the app.AppCodec instead.
// [DEPRECATED]
func MakeTestEncodingConfig() simappparams.EncodingConfig {
encodingConfig := simappparams.MakeTestEncodingConfig()
Expand Down
2 changes: 1 addition & 1 deletion simd/cmd/genaccounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestAddGenesisAccountCmd(t *testing.T) {
cfg, err := genutiltest.CreateDefaultTendermintConfig(home)
require.NoError(t, err)

appCodec, _ := simapp.MakeCodecs()
appCodec := simapp.MakeTestEncodingConfig().Marshaler
err = genutiltest.ExecInitCmd(testMbm, home, appCodec)
require.NoError(t, err)

Expand Down

0 comments on commit 0b97dee

Please sign in to comment.