Skip to content

Commit

Permalink
chore: consensus module included
Browse files Browse the repository at this point in the history
  • Loading branch information
deepan95dev committed Feb 27, 2024
1 parent 9d0f758 commit 9748dca
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 338 deletions.
1 change: 0 additions & 1 deletion .github/linters/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ run:


linters:
disable-all: true
enable:
- bodyclose
- depguard
Expand Down
12 changes: 12 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os"
"path/filepath"

"github.com/cosmos/cosmos-sdk/x/consensus"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
"github.com/cheqd/cheqd-node/app/migrations"
Expand Down Expand Up @@ -121,6 +123,7 @@ import (
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
Expand Down Expand Up @@ -166,6 +169,7 @@ var (
did.AppModuleBasic{},
resource.AppModuleBasic{},
ibcfee.AppModuleBasic{},
consensus.AppModuleBasic{},
)

// module account permissions
Expand Down Expand Up @@ -627,6 +631,7 @@ func New(
params.NewAppModule(app.ParamsKeeper),
// IBC modules
transfer.NewAppModule(app.TransferKeeper),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
icaModule,
// cheqd modules
Expand Down Expand Up @@ -663,6 +668,7 @@ func New(
ibcfeetypes.ModuleName,
didtypes.ModuleName,
resourcetypes.ModuleName,
consensusparamtypes.ModuleName,
)

app.ModuleManager.SetOrderEndBlockers(
Expand All @@ -689,6 +695,7 @@ func New(
vestingtypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
consensusparamtypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -720,6 +727,7 @@ func New(
vestingtypes.ModuleName,
upgradetypes.ModuleName,
paramstypes.ModuleName,
consensusparamtypes.ModuleName,
}
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -1186,6 +1194,10 @@ func (app *App) RegisterUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(
upgradeV2.UpgradeName,
func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
_, err := ibctmmigrations.PruneExpiredConsensusStates(ctx, app.appCodec, app.IBCKeeper.ClientKeeper)
if err != nil {
return nil, err
}
ctx.Logger().Info("Handler for upgrade plan: " + upgradeV2.UpgradeName)
// Migrate Tendermint consensus parameters from x/params module to a
// dedicated x/consensus module.
Expand Down
176 changes: 0 additions & 176 deletions app/migrations/migration_did_protobuf.go

This file was deleted.

80 changes: 0 additions & 80 deletions app/migrations/migration_resource_protobuf.go

This file was deleted.

Loading

0 comments on commit 9748dca

Please sign in to comment.