From 040b46cf38dfafc921ff5ff515451895d2832692 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 25 Jun 2024 14:23:58 +0200 Subject: [PATCH] updates --- scripts/simapp-v2-init.sh | 2 +- simapp/v2/app_di.go | 2 +- x/upgrade/depinject.go | 16 ++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/simapp-v2-init.sh b/scripts/simapp-v2-init.sh index 6bdb51de7b57..b53f4d9f63e4 100755 --- a/scripts/simapp-v2-init.sh +++ b/scripts/simapp-v2-init.sh @@ -13,7 +13,7 @@ CONFIG="${CONFIG:-$HOME/.simappv2/config}" cd "$SIMAPP_DIR" go build -o "$ROOT/build/simdv2" simdv2/main.go -if [ -d "$($SIMD config home)" ]; then rm -r $($SIMD config home); fi +if [ -d "$($SIMD config home)" ]; then rm -rv $($SIMD config home); fi $SIMD init simapp-v2-node --chain-id simapp-v2-chain diff --git a/simapp/v2/app_di.go b/simapp/v2/app_di.go index ef81c1d604dc..4211bc905d28 100644 --- a/simapp/v2/app_di.go +++ b/simapp/v2/app_di.go @@ -76,7 +76,7 @@ type SimApp struct { func init() { var err error - DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory(".simapp") + DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory(".simappv2") if err != nil { panic(err) } diff --git a/x/upgrade/depinject.go b/x/upgrade/depinject.go index 0dcdb7e5b9e4..be1187c3f684 100644 --- a/x/upgrade/depinject.go +++ b/x/upgrade/depinject.go @@ -59,22 +59,18 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { skipUpgradeHeights = make(map[int64]bool) ) - if in.AppOpts != nil && in.Viper != nil { - panic("cannot provide both server v0 and server v2 options (appOpts and viper)") - } - - if in.AppOpts != nil { - for _, h := range cast.ToIntSlice(in.AppOpts.Get(server.FlagUnsafeSkipUpgrades)) { + if in.Viper != nil { // viper takes precedence over app options + for _, h := range in.Viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) { skipUpgradeHeights[int64(h)] = true } - homePath = cast.ToString(in.AppOpts.Get(flags.FlagHome)) - } else if in.Viper != nil { - for _, h := range in.Viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) { + homePath = in.Viper.GetString(flags.FlagHome) + } else if in.AppOpts != nil { + for _, h := range cast.ToIntSlice(in.AppOpts.Get(server.FlagUnsafeSkipUpgrades)) { skipUpgradeHeights[int64(h)] = true } - homePath = in.Viper.GetString(flags.FlagHome) + homePath = cast.ToString(in.AppOpts.Get(flags.FlagHome)) } // default to governance authority if not provided