Skip to content

Commit

Permalink
now upgrade works
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroms committed Dec 12, 2024
1 parent ce24ff2 commit b3e27e5
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ import (
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v8/modules/core"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
Expand Down Expand Up @@ -775,7 +777,6 @@ func New(
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.mm.SetOrderBeginBlockers(
upgradetypes.ModuleName,
timerstoretypes.ModuleName,
fixationtypes.ModuleName,
capabilitytypes.ModuleName,
Expand Down Expand Up @@ -809,6 +810,10 @@ func New(
feegrant.ModuleName,
paramstypes.ModuleName)

app.mm.SetOrderPreBlockers(
upgradetypes.ModuleName,
)

app.mm.SetOrderEndBlockers(
capabilitytypes.ModuleName,
authtypes.ModuleName,
Expand Down Expand Up @@ -956,6 +961,7 @@ func New(
ante.DefaultSigVerificationGasConsumer),
)
app.SetEndBlocker(app.EndBlocker)
app.SetPreBlocker(app.PreBlocker)

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
Expand Down Expand Up @@ -1016,6 +1022,10 @@ func (app *LavaApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
return app.mm.EndBlock(ctx)
}

func (app *LavaApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) {
return app.mm.PreBlock(ctx)
}

// InitChainer application update at chain initialization
func (app *LavaApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
var genesisState GenesisState
Expand Down Expand Up @@ -1149,17 +1159,21 @@ func GetMaccPerms() map[string][]string {
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)

// legacy param set to for ibc migrator
keyTable := ibcclienttypes.ParamKeyTable()
keyTable.RegisterParamSet(&ibcconnectiontypes.Params{})
paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)
paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())
paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())
paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable())

paramsKeeper.Subspace(authtypes.ModuleName)
paramsKeeper.Subspace(banktypes.ModuleName)
paramsKeeper.Subspace(stakingtypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(v1.ParamKeyTable()) //nolint:staticcheck
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable())
paramsKeeper.Subspace(specmoduletypes.ModuleName)
paramsKeeper.Subspace(epochstoragemoduletypes.ModuleName)
Expand Down

0 comments on commit b3e27e5

Please sign in to comment.