Skip to content

Commit

Permalink
rename upgrades for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnfoo committed Jan 23, 2025
1 parent e643ad6 commit 9fd7f3a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"github.com/nymtech/nyxd/app/upgrades"
"github.com/nymtech/nyxd/app/upgrades/noop"
v054 "github.com/nymtech/nyxd/app/upgrades/v054"
v054doubledip "github.com/nymtech/nyxd/app/upgrades/v054-doubledip"
v054testnet "github.com/nymtech/nyxd/app/upgrades/v054-testnet"
)

// Upgrades list of chain upgrades
var Upgrades = []upgrades.Upgrade{v054doubledip.Upgrade, v054.Upgrade}
var Upgrades = []upgrades.Upgrade{v054testnet.Upgrade, v054.Upgrade}

// RegisterUpgradeHandlers registers the chain upgrade handlers
func (app *WasmApp) RegisterUpgradeHandlers() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
package v054doubledip
package v054testnet

import (
"context"
"fmt"
"time"

sdkmath "cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"
circuittypes "cosmossdk.io/x/circuit/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"

"github.com/nymtech/nyxd/app/upgrades"
)

// UpgradeName defines the on-chain upgrade name
const UpgradeName = "v0.54-doubledip"
const UpgradeName = "v0.54-testnet"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: storetypes.StoreUpgrades{
Added: []string{
circuittypes.ModuleName,
},
Added: []string{},
Deleted: []string{},
},
}
Expand Down Expand Up @@ -117,6 +114,8 @@ func CreateUpgradeHandler(
depositDenom, depositAmount := govParams.MinDeposit[0].Denom, govParams.MinDeposit[0].Amount.Mul(sdkmath.NewInt(5))
govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewInt64Coin(depositDenom, depositAmount.Int64()))
govParams.ProposalCancelRatio = sdkmath.LegacyZeroDec().String()
expeditedPeriod := time.Duration(govParams.VotingPeriod.Seconds() / 2)
govParams.ExpeditedVotingPeriod = &expeditedPeriod

ok := ak.GovKeeper.Params.Set(ctx, govParams)

Expand Down
11 changes: 6 additions & 5 deletions app/upgrades/v054/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package v054
import (
"context"
"fmt"
"time"

sdkmath "cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"
circuittypes "cosmossdk.io/x/circuit/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"

"github.com/nymtech/nyxd/app/upgrades"
)
Expand All @@ -22,7 +23,9 @@ var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: storetypes.StoreUpgrades{
Added: []string{},
Added: []string{
circuittypes.ModuleName,
},
Deleted: []string{},
},
}
Expand Down Expand Up @@ -114,8 +117,6 @@ func CreateUpgradeHandler(
depositDenom, depositAmount := govParams.MinDeposit[0].Denom, govParams.MinDeposit[0].Amount.Mul(sdkmath.NewInt(5))
govParams.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewInt64Coin(depositDenom, depositAmount.Int64()))
govParams.ProposalCancelRatio = sdkmath.LegacyZeroDec().String()
expeditedPeriod := time.Duration(govParams.VotingPeriod.Seconds() / 2)
govParams.ExpeditedVotingPeriod = &expeditedPeriod

ok := ak.GovKeeper.Params.Set(ctx, govParams)

Expand Down

0 comments on commit 9fd7f3a

Please # to comment.