feat: migrate x/crisis use app wiring (#12389)

Co-authored-by: JeancarloBarrios <jeancarlobarrios@users.noreply.github.com>
This commit is contained in:
Julien Robert
2022-06-30 17:57:19 +02:00
committed by GitHub
co-authored by JeancarloBarrios
parent 17dc431666
commit 77cf43009a
33 changed files with 1002 additions and 133 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ type AppConstructor = func(val Validator) servertypes.Application
func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor {
return func(val Validator) servertypes.Application {
return simapp.NewSimApp(
val.Ctx.Logger, dbm.NewMemDB(), nil, true, 0,
val.Ctx.Logger, dbm.NewMemDB(), nil, true,
encodingCfg,
simtestutil.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir),
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
+6 -1
View File
@@ -245,7 +245,12 @@ func (ao EmptyAppOptions) Get(o string) interface{} {
type AppOptionsMap map[string]interface{}
func (m AppOptionsMap) Get(key string) interface{} {
return m[key]
v, ok := m[key]
if !ok {
return interface{}(nil)
}
return v
}
func NewAppOptionsWithFlagHome(homePath string) servertypes.AppOptions {