diff --git a/CHANGELOG.md b/CHANGELOG.md index e2670454a86a..32c822791c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators * (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id. +* (client) [#22261](https://github.com/cosmos/cosmos-sdk/pull/22261) Explicitly set the client configuration file. ### API Breaking Changes diff --git a/client/config/toml.go b/client/config/toml.go index 35787219a236..e1ad050090b8 100644 --- a/client/config/toml.go +++ b/client/config/toml.go @@ -2,6 +2,7 @@ package config import ( "bytes" + "fmt" "os" "text/template" @@ -75,9 +76,14 @@ func writeConfigFile(configFilePath string, config interface{}) error { // getClientConfig reads values from client.toml file and unmarshalls them into ClientConfig func getClientConfig(configPath string, v *viper.Viper) (*Config, error) { + const ( + confName = "client" + confType = "toml" + ) v.AddConfigPath(configPath) - v.SetConfigName("client") - v.SetConfigType("toml") + v.SetConfigName(confName) + v.SetConfigType(confType) + v.SetConfigFile(fmt.Sprintf("%s/%s.%s", configPath, confName, confType)) if err := v.ReadInConfig(); err != nil { return nil, err