generated from dymensionxyz/rollapp
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package v2_2_0 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" | ||
rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
rpKeeper rollappparamskeeper.Keeper, | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
da := rpKeeper.DA(ctx) | ||
version := uint32(2) | ||
params := rollappparamstypes.DefaultParams() | ||
params.Da = da | ||
params.DrsVersion = version | ||
|
||
rpKeeper.SetParams(ctx, params) | ||
|
||
return mm.RunMigrations(ctx, configurator, fromVM) | ||
} | ||
} |