File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package keeper
33import (
44 sdk "github.com/cosmos/cosmos-sdk/types"
55 v043 "github.com/cosmos/cosmos-sdk/x/gov/legacy/v043"
6+ v3 "github.com/cosmos/cosmos-sdk/x/gov/legacy/v3"
67)
78
89// Migrator is a struct for handling in-place store migrations.
@@ -19,3 +20,8 @@ func NewMigrator(keeper Keeper) Migrator {
1920func (m Migrator ) Migrate1to2 (ctx sdk.Context ) error {
2021 return v043 .MigrateStore (ctx , m .keeper .storeKey , m .keeper .cdc )
2122}
23+
24+ // Migrate2to3 migrates from version 2 to 3.
25+ func (m Migrator ) Migrate2to3 (ctx sdk.Context ) error {
26+ return v3 .MigrateStore (ctx , m .keeper .paramSpace )
27+ }
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package v3
33import (
44 sdk "github.com/cosmos/cosmos-sdk/types"
55 "github.com/cosmos/cosmos-sdk/x/gov/types"
6- paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
76)
87
98var minInitialDepositRatio = sdk .NewDec (25 ).Quo (sdk .NewDec (100 ))
@@ -16,12 +15,12 @@ var minInitialDepositRatio = sdk.NewDec(25).Quo(sdk.NewDec(100))
1615// The migration includes:
1716//
1817// - Setting the minimum deposit param in the paramstore.
19- func MigrateStore (ctx sdk.Context , paramstore paramtypes. Subspace ) error {
18+ func MigrateStore (ctx sdk.Context , paramstore types. ParamSubspace ) error {
2019 migrateParamsStore (ctx , paramstore )
2120 return nil
2221}
2322
24- func migrateParamsStore (ctx sdk.Context , paramstore paramtypes. Subspace ) {
23+ func migrateParamsStore (ctx sdk.Context , paramstore types. ParamSubspace ) {
2524 var depositParams types.DepositParams
2625 paramstore .Get (ctx , types .ParamStoreKeyDepositParams , & depositParams )
2726 depositParams .MinInitialDepositRatio = minInitialDepositRatio
Original file line number Diff line number Diff line change @@ -161,6 +161,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
161161 if err != nil {
162162 panic (err )
163163 }
164+ cfg .RegisterMigration (types .ModuleName , 2 , m .Migrate2to3 )
165+ if err != nil {
166+ panic (err )
167+ }
164168}
165169
166170// InitGenesis performs genesis initialization for the gov module. It returns
You can’t perform that action at this time.
0 commit comments