Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed May 23, 2024
1 parent c90c6ac commit e3c0a03
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### API Breaking Changes

* (server) [#20422](https://github.com/cosmos/cosmos-sdk/pull/20422) Remove `cmtcfg.Config` from `ServerContext`. To get `cmtcfg.Config` from cmd, use `client.GetConfigFromCmd(cmd)` instead of `server.GetServerContextFromCmd(cmd).Config`
* (server) [#20422](https://github.com/cosmos/cosmos-sdk/pull/20422) Deprecated `ServerContext`. To get `cmtcfg.Config` from cmd, use `client.GetCometConfigFromCmd(cmd)` instead of `server.GetServerContextFromCmd(cmd).Config`
* (types)[#20369](https://github.com/cosmos/cosmos-sdk/pull/20369) The signature of `HasAminoCodec` has changed to accept a `core/legacy.Amino` interface instead of `codec.LegacyAmino`.
* (x/simulation)[#20056](https://github.com/cosmos/cosmos-sdk/pull/20056) `SimulateFromSeed` now takes an address codec as argument.
* (x/crisis) [#20043](https://github.com/cosmos/cosmos-sdk/pull/20043) Changed `NewMsgVerifyInvariant` to accept a string as argument instead of an `AccAddress`.
Expand Down
3 changes: 0 additions & 3 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error {

cmd.SetContext(cmdCtx)

fmt.Println("After set", serverCtx.Viper.GetString(flags.FlagHome))

return nil
}

Expand All @@ -243,7 +241,6 @@ func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error {
// viperCfg object.
func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customConfig interface{}, cmtConfig *cmtcfg.Config) (*cmtcfg.Config, error) {
rootDir := rootViper.GetString(flags.FlagHome)
fmt.Println("Init root", rootDir)
configPath := filepath.Join(rootDir, "config")
cmtCfgFile := filepath.Join(configPath, "config.toml")

Expand Down
2 changes: 1 addition & 1 deletion simapp/simd/cmd/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Test_TestnetCmd(t *testing.T) {
err = genutiltest.ExecInitCmd(moduleManager, home, encodingConfig.Codec)
require.NoError(t, err)

err = genutiltest.WriteAndTrackConfig(viper, home, cfg)
err = genutiltest.WriteAndTrackCometConfig(viper, home, cfg)
require.NoError(t, err)
clientCtx := client.Context{}.
WithCodec(encodingConfig.Codec).
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/genutil/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, ge
assert.NilError(t, err)

viper := viper.New()
err = gentestutil.WriteAndTrackConfig(viper, tempDir, cmtcfg.DefaultConfig())
err = gentestutil.WriteAndTrackCometConfig(viper, tempDir, cmtcfg.DefaultConfig())
assert.NilError(t, err)

clientCtx := client.Context{}.WithCodec(app.AppCodec())
Expand Down
2 changes: 1 addition & 1 deletion testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func collectGenFiles(cfg Config, vals []*Validator, cmtConfigs []*cmtcfg.Config,
}

v := vals[i].GetViper()
err = genutiltest.TrackConfig(v, nodeDir)
err = genutiltest.TrackCometConfig(v, nodeDir)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion x/genutil/client/cli/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,5 @@ func writeAndTrackDefaultConfig(v *viper.Viper, home string) error {
if err != nil {
return err
}
return genutiltest.WriteAndTrackConfig(v, home, cfg)
return genutiltest.WriteAndTrackCometConfig(v, home, cfg)
}
6 changes: 3 additions & 3 deletions x/genutil/client/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func ExecInitCmd(mm *module.Manager, home string, cdc codec.Codec) error {
viper := viper.New()
cmd := genutilcli.InitCmd(mm)
cfg, _ := CreateDefaultCometConfig(home)
err := WriteAndTrackConfig(viper, home, cfg)
err := WriteAndTrackCometConfig(viper, home, cfg)
if err != nil {
return err
}
Expand Down Expand Up @@ -55,7 +55,7 @@ func CreateDefaultCometConfig(rootDir string) (*cmtcfg.Config, error) {
return conf, nil
}

func WriteAndTrackConfig(v *viper.Viper, home string, cfg *cmtcfg.Config) error {
func WriteAndTrackCometConfig(v *viper.Viper, home string, cfg *cmtcfg.Config) error {
cmtcfg.WriteConfigFile(filepath.Join(home, "config", "config.toml"), cfg)

v.Set(flags.FlagHome, home)
Expand All @@ -65,7 +65,7 @@ func WriteAndTrackConfig(v *viper.Viper, home string, cfg *cmtcfg.Config) error
return v.ReadInConfig()
}

func TrackConfig(v *viper.Viper, home string) error {
func TrackCometConfig(v *viper.Viper, home string) error {
v.Set(flags.FlagHome, home)
v.SetConfigType("toml")
v.SetConfigName("config")
Expand Down
3 changes: 0 additions & 3 deletions x/genutil/collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ func TestCollectTxsHandlesDirectories(t *testing.T) {
})

// 2. Ensure that we don't encounter any error traversing the directory.
// What is this for???
// srvCtx := server.NewDefaultContext()
// _ = srvCtx
cdc := codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
genesis := &types.AppGenesis{AppState: []byte("{}")}
balItr := new(doNothingIterator)
Expand Down

0 comments on commit e3c0a03

Please sign in to comment.