Skip to content

Commit

Permalink
Merge pull request #555 from comdex-official/app-restructure
Browse files Browse the repository at this point in the history
restructure init and end blocker modules
  • Loading branch information
dheerajkd30 authored Oct 30, 2022
2 parents 720c3fe + e500fb2 commit 97a2d35
Showing 1 changed file with 73 additions and 21 deletions.
94 changes: 73 additions & 21 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ import (

"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"

authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module"
Expand Down Expand Up @@ -855,24 +856,75 @@ func New(
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.mm.SetOrderBeginBlockers(
upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName,
bandoraclemoduletypes.ModuleName, markettypes.ModuleName, lockertypes.ModuleName,
crisistypes.ModuleName, genutiltypes.ModuleName, authtypes.ModuleName, capabilitytypes.ModuleName,
authz.ModuleName, transferModule.Name(), assettypes.ModuleName, collectortypes.ModuleName, vaulttypes.ModuleName,
liquidationtypes.ModuleName, auctiontypes.ModuleName, tokenminttypes.ModuleName,
vesting.AppModuleBasic{}.Name(), paramstypes.ModuleName, wasmtypes.ModuleName, banktypes.ModuleName,
govtypes.ModuleName, rewardstypes.ModuleName, liquiditytypes.ModuleName, lendtypes.ModuleName, esmtypes.ModuleName,
upgradetypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
genutiltypes.ModuleName,
feegrant.ModuleName,
authtypes.ModuleName,
capabilitytypes.ModuleName,
authz.ModuleName,
assettypes.ModuleName,
collectortypes.ModuleName,
vaulttypes.ModuleName,
bandoraclemoduletypes.ModuleName,
markettypes.ModuleName,
lockertypes.ModuleName,
liquidationtypes.ModuleName,
auctiontypes.ModuleName,
tokenminttypes.ModuleName,
vestingtypes.ModuleName,
paramstypes.ModuleName,
wasmtypes.ModuleName,
banktypes.ModuleName,
rewardstypes.ModuleName,
liquiditytypes.ModuleName,
lendtypes.ModuleName,
esmtypes.ModuleName,
)

app.mm.SetOrderEndBlockers(
crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName,
minttypes.ModuleName, bandoraclemoduletypes.ModuleName, markettypes.ModuleName, lockertypes.ModuleName,
distrtypes.ModuleName, genutiltypes.ModuleName, vesting.AppModuleBasic{}.Name(), evidencetypes.ModuleName, ibchost.ModuleName,
icatypes.ModuleName, vaulttypes.ModuleName, liquidationtypes.ModuleName, auctiontypes.ModuleName, tokenminttypes.ModuleName,
wasmtypes.ModuleName, authtypes.ModuleName, slashingtypes.ModuleName, authz.ModuleName,
paramstypes.ModuleName, capabilitytypes.ModuleName, upgradetypes.ModuleName, transferModule.Name(), lendtypes.ModuleName,
assettypes.ModuleName, collectortypes.ModuleName, banktypes.ModuleName, rewardstypes.ModuleName, liquiditytypes.ModuleName, esmtypes.ModuleName,
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
genutiltypes.ModuleName,
feegrant.ModuleName,
vestingtypes.ModuleName,
evidencetypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
ibctransfertypes.ModuleName,
authtypes.ModuleName,
slashingtypes.ModuleName,
authz.ModuleName,
paramstypes.ModuleName,
capabilitytypes.ModuleName,
upgradetypes.ModuleName,
bandoraclemoduletypes.ModuleName,
markettypes.ModuleName,
lockertypes.ModuleName,
vaulttypes.ModuleName,
liquidationtypes.ModuleName,
auctiontypes.ModuleName,
tokenminttypes.ModuleName,
wasmtypes.ModuleName,
lendtypes.ModuleName,
assettypes.ModuleName,
collectortypes.ModuleName,
banktypes.ModuleName,
rewardstypes.ModuleName,
liquiditytypes.ModuleName,
esmtypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand All @@ -889,12 +941,16 @@ func New(
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
ibctransfertypes.ModuleName,
wasmtypes.ModuleName,
authz.ModuleName,
vestingtypes.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
assettypes.ModuleName,
collectortypes.ModuleName,
esmtypes.ModuleName,
Expand All @@ -906,13 +962,9 @@ func New(
liquidationtypes.ModuleName,
auctiontypes.ModuleName,
lockertypes.StoreKey,
wasmtypes.ModuleName,
authz.ModuleName,
vesting.AppModuleBasic{}.Name(),
upgradetypes.ModuleName,
paramstypes.ModuleName,
liquiditytypes.ModuleName,
rewardstypes.ModuleName,
crisistypes.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand Down

0 comments on commit 97a2d35

Please sign in to comment.