Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jun 25, 2024
1 parent 8b83783 commit 040b46c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/simapp-v2-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion simapp/v2/app_di.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
16 changes: 6 additions & 10 deletions x/upgrade/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 040b46c

Please sign in to comment.