Skip to content

feat: Cosmos SDK v53 support #2206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ type WasmApp struct {
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper //nolint // TODO remove deprecated module
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
ParamsKeeper paramskeeper.Keeper //nolint // TODO remove deprecated module
AuthzKeeper authzkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
Expand Down Expand Up @@ -418,7 +418,7 @@ func NewWasmApp(
)

invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
app.CrisisKeeper = crisiskeeper.NewKeeper(
app.CrisisKeeper = crisiskeeper.NewKeeper( //nolint // TODO remove deprecated module
appCodec,
runtime.NewKVStoreService(keys[crisistypes.StoreKey]),
invCheckPeriod,
Expand Down Expand Up @@ -656,7 +656,7 @@ func NewWasmApp(

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) //nolint // TODO remove deprecated module

// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
Expand All @@ -678,7 +678,7 @@ func NewWasmApp(
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()),
evidence.NewAppModule(app.EvidenceKeeper),
params.NewAppModule(app.ParamsKeeper),
params.NewAppModule(app.ParamsKeeper), //nolint // TODO remove deprecated module
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
nftmodule.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
Expand All @@ -691,7 +691,7 @@ func NewWasmApp(
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
ibctm.NewAppModule(tmLightClientModule),
// sdk
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), //nolint // TODO remove deprecated module
)

// BasicModuleManager defines the module BasicManager is in charge of setting up basic,
Expand All @@ -714,6 +714,7 @@ func NewWasmApp(
// NOTE: upgrade module is required to be prioritized
app.ModuleManager.SetOrderPreBlockers(
upgradetypes.ModuleName,
authtypes.ModuleName,
)
// During begin block slashing happens after distr.BeginBlocker so that
// there is nothing left over in the validator fee pool, so as to keep the
Expand Down Expand Up @@ -777,7 +778,7 @@ func NewWasmApp(
// Uncomment if you want to set a custom migration order here.
// app.ModuleManager.SetOrderMigrations(custom order)

app.ModuleManager.RegisterInvariants(app.CrisisKeeper)
app.ModuleManager.RegisterInvariants(app.CrisisKeeper) //nolint // TODO remove deprecated module
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
err = app.ModuleManager.RegisterServices(app.configurator)
if err != nil {
Expand Down Expand Up @@ -1107,8 +1108,8 @@ func BlockedAddresses() map[string]bool {
}

// initParamsKeeper init params keeper and its subspaces
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { //nolint // TODO remove deprecated module
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) //nolint // TODO remove deprecated module

paramsKeeper.Subspace(authtypes.ModuleName)
paramsKeeper.Subspace(banktypes.ModuleName)
Expand Down
1 change: 1 addition & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (app *WasmApp) RegisterUpgradeHandlers() {
}
}

// nolint // TODO remove deprecated module
func setupLegacyKeyTables(k *paramskeeper.Keeper) {
for _, subspace := range k.GetSubspaces() {
subspace := subspace
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

type AppKeepers struct {
AccountKeeper *authkeeper.AccountKeeper
ParamsKeeper *paramskeeper.Keeper
ParamsKeeper *paramskeeper.Keeper //nolint // TODO remove deprecated module
ConsensusParamsKeeper *consensusparamkeeper.Keeper
Codec codec.Codec
GetStoreKey func(storeKey string) *storetypes.KVStoreKey
Expand Down
2 changes: 1 addition & 1 deletion cmd/wasmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func initRootCmd(
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
crisis.AddModuleInitFlags(startCmd) //nolint // TODO remove deprecated module
wasm.AddModuleInitFlags(startCmd)
}

Expand Down
Loading