From 193309b74b2d188a4bbd90b2c212b1df73bdff61 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 14 Oct 2024 18:39:06 -0300 Subject: [PATCH 1/3] fix(config): get desired config file --- client/config/toml.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/config/toml.go b/client/config/toml.go index 35787219a236..e74d1c635968 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.SetConfigFile(fmt.Sprintf("%s/%s.%s", configPath, confName, confType)) if err := v.ReadInConfig(); err != nil { return nil, err From a10e57da1f73860f46884fbcd8b2c57289e12ef4 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 14 Oct 2024 18:52:18 -0300 Subject: [PATCH 2/3] use const --- client/config/toml.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/config/toml.go b/client/config/toml.go index e74d1c635968..e1ad050090b8 100644 --- a/client/config/toml.go +++ b/client/config/toml.go @@ -81,8 +81,8 @@ func getClientConfig(configPath string, v *viper.Viper) (*Config, error) { 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 { From df942f77ec46b3217af899225efee49596d77f3a Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 14 Oct 2024 18:59:39 -0300 Subject: [PATCH 3/3] add chlog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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