From c5b8a521b3a034dc0cd1a631d1ac79b8ac16736e Mon Sep 17 00:00:00 2001 From: Andrei Ivasko Date: Fri, 21 May 2021 14:06:43 +0300 Subject: [PATCH] add MinGasPrices check in interceptConfigs --- server/start.go | 6 +----- server/util.go | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/server/start.go b/server/start.go index 61d7df0db8ab..dd0b7d270ad3 100644 --- a/server/start.go +++ b/server/start.go @@ -122,11 +122,7 @@ which accepts a path for the resulting pprof file. serverCtx.Logger.Info("starting ABCI without Tendermint") return startStandAlone(serverCtx, appCreator) } - - if flagMinGasPricesStr, _ := cmd.Flags().GetString(FlagMinGasPrices); flagMinGasPricesStr == "" { - return fmt.Errorf("FlagMinGasPrices must not be empty") - } - + serverCtx.Logger.Info("starting ABCI with Tendermint") // amino is needed here for backwards compatibility of REST routes diff --git a/server/util.go b/server/util.go index 68f1c4828166..37f08a63a813 100644 --- a/server/util.go +++ b/server/util.go @@ -230,10 +230,15 @@ func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) { if err != nil { return nil, fmt.Errorf("failed to parse %s: %w", appCfgFilePath, err) } + // TODO manual testing with config + if appConf.MinGasPrices == ""{ + return nil, fmt.Errorf("MinGasPrices is empty in %s", appCfgFilePath) + } config.WriteConfigFile(appCfgFilePath, appConf) } + rootViper.SetConfigType("toml") rootViper.SetConfigName("app") rootViper.AddConfigPath(configPath)