Skip to content

Commit 3e097f4

Browse files
authored
Merge pull request #485 from persistenceOne/puneet/remove-crisis
remove: crisis module
2 parents 690f110 + fc20e4a commit 3e097f4

8 files changed

Lines changed: 11 additions & 32 deletions

File tree

app/encoding.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
1111
"github.com/cosmos/cosmos-sdk/std"
1212
"github.com/cosmos/cosmos-sdk/types/module"
13+
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
1314
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
1415
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
1516
interchainquerytypes "github.com/persistenceOne/persistence-sdk/v7/x/interchainquery/types"
@@ -76,6 +77,9 @@ func AppendModuleInterfaces(interfaceRegistry codectypes.InterfaceRegistry, mbm
7677

7778
// params types proposals
7879
paramstypes.RegisterInterfaces(interfaceRegistry)
80+
81+
//crisis types
82+
crisistypes.RegisterInterfaces(interfaceRegistry)
7983
}
8084

8185
func AppendModuleLegacyCodecs(amino *codec.LegacyAmino, mbm module.BasicManager) {
@@ -112,4 +116,6 @@ func AppendModuleLegacyCodecs(amino *codec.LegacyAmino, mbm module.BasicManager)
112116
// params types proposals
113117
paramstypes.RegisterLegacyAminoCodec(amino)
114118

119+
//crisis types
120+
crisistypes.RegisterLegacyAminoCodec(amino)
115121
}

app/export.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ func (app *Application) ExportAppStateAndValidators(forZeroHeight bool, jailWhit
4444
}
4545

4646
func (app *Application) prepForZeroHeightGenesis(context sdk.Context, jailWhiteList []string) {
47-
/* Just to be safe, assert the invariants on current state. */
48-
app.CrisisKeeper.AssertInvariants(context)
4947

5048
/* Handle fee distribution state. */
5149

app/keepers/keepers.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import (
2828
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2929
consensusparamskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
3030
consensusparamstypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
31-
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
32-
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
3331
distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
3432
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
3533
epochskeeper "github.com/cosmos/cosmos-sdk/x/epochs/keeper"
@@ -91,7 +89,6 @@ type AppKeepers struct {
9189
GovKeeper *govkeeper.Keeper
9290
ProtocolPoolKeeper *protocolpoolkeeper.Keeper
9391
UpgradeKeeper *upgradekeeper.Keeper
94-
CrisisKeeper *crisiskeeper.Keeper
9592
IBCKeeper *ibckeeper.Keeper
9693
ICAHostKeeper *icahostkeeper.Keeper
9794
EvidenceKeeper *evidencekeeper.Keeper
@@ -233,17 +230,6 @@ func NewAppKeeper(
233230
)
234231
appKeepers.SlashingKeeper = &slashingKeeper
235232

236-
invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
237-
appKeepers.CrisisKeeper = crisiskeeper.NewKeeper(
238-
appCodec,
239-
runtime.NewKVStoreService(appKeepers.keys[crisistypes.StoreKey]),
240-
invCheckPeriod,
241-
appKeepers.BankKeeper,
242-
authtypes.FeeCollectorName,
243-
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
244-
appKeepers.AccountKeeper.AddressCodec(),
245-
)
246-
247233
// get skipUpgradeHeights from the app options
248234
skipUpgradeHeights := map[int64]bool{}
249235
for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {

app/keepers/keys.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
1111
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
1212
consensusparamstypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
13-
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
1413
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
1514
epochstypes "github.com/cosmos/cosmos-sdk/x/epochs/types"
1615
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
@@ -37,7 +36,6 @@ func (appKeepers *AppKeepers) GenerateKeys() {
3736
authzkeeper.StoreKey,
3837
banktypes.StoreKey,
3938
consensusparamstypes.StoreKey,
40-
crisistypes.StoreKey,
4139
distributiontypes.StoreKey,
4240
epochstypes.StoreKey,
4341
evidencetypes.StoreKey,

app/modules.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import (
2222
"github.com/cosmos/cosmos-sdk/x/bank"
2323
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2424
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
25-
"github.com/cosmos/cosmos-sdk/x/crisis"
26-
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
2725
"github.com/cosmos/cosmos-sdk/x/distribution"
2826
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
2927
"github.com/cosmos/cosmos-sdk/x/epochs"
@@ -110,7 +108,6 @@ func appModules(
110108
epochs.NewAppModule(*app.EpochsKeeper),
111109
liquid.NewAppModule(appCodec, app.LiquidKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
112110
liquidstake.NewAppModule(*app.LiquidStakeKeeper),
113-
crisis.NewAppModule(app.CrisisKeeper, false, nil), // skipGenesisInvariants: false, always be last to make sure that it checks for all invariants and not only part of them
114111
ibctm.NewAppModule(app.TMLightClientModule),
115112
protocolpool.NewAppModule(*app.ProtocolPoolKeeper, app.AccountKeeper, app.BankKeeper),
116113
}
@@ -139,7 +136,6 @@ func orderBeginBlockers() []string {
139136
minttypes.ModuleName,
140137
distributiontypes.ModuleName,
141138
protocolpooltypes.ModuleName,
142-
crisistypes.ModuleName,
143139
govtypes.ModuleName,
144140
stakingtypes.ModuleName,
145141
ibctransfertypes.ModuleName,
@@ -165,7 +161,6 @@ func orderBeginBlockers() []string {
165161

166162
func orderEndBlockers() []string {
167163
return []string{
168-
crisistypes.ModuleName,
169164
govtypes.ModuleName,
170165
stakingtypes.ModuleName,
171166
ibctransfertypes.ModuleName,
@@ -209,7 +204,6 @@ func orderInitGenesis() []string {
209204
slashingtypes.ModuleName,
210205
govtypes.ModuleName,
211206
minttypes.ModuleName,
212-
crisistypes.ModuleName,
213207
ibctransfertypes.ModuleName,
214208
ibcexported.ModuleName,
215209
icatypes.ModuleName,
@@ -241,7 +235,6 @@ func orderExportGenesis() []string {
241235
slashingtypes.ModuleName,
242236
govtypes.ModuleName,
243237
minttypes.ModuleName,
244-
crisistypes.ModuleName,
245238
genutiltypes.ModuleName,
246239
evidencetypes.ModuleName,
247240
authz.ModuleName,

app/upgrades/testnet/v17.0.0-rc0/constants.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package v17_0_0_rc0
22

33
import (
44
store "cosmossdk.io/store/types"
5+
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
56
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
67

78
"github.com/persistenceOne/persistenceCore/v17/app/upgrades"
@@ -17,6 +18,6 @@ var Upgrade = upgrades.Upgrade{
1718
CreateUpgradeHandler: CreateUpgradeHandler,
1819
StoreUpgrades: store.StoreUpgrades{
1920
Added: []string{},
20-
Deleted: []string{paramstypes.StoreKey},
21+
Deleted: []string{paramstypes.StoreKey, crisistypes.StoreKey},
2122
},
2223
}

app/upgrades/v17.0.0/constants.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package v17_0_0
22

33
import (
44
store "cosmossdk.io/store/types"
5+
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
56
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
67

78
"github.com/persistenceOne/persistenceCore/v17/app/upgrades"
@@ -17,6 +18,6 @@ var Upgrade = upgrades.Upgrade{
1718
CreateUpgradeHandler: CreateUpgradeHandler,
1819
StoreUpgrades: store.StoreUpgrades{
1920
Added: []string{},
20-
Deleted: []string{paramstypes.StoreKey},
21+
Deleted: []string{paramstypes.StoreKey, crisistypes.StoreKey},
2122
},
2223
}

x/liquidstake/keeper/keeper_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
sdk "github.com/cosmos/cosmos-sdk/types"
1313
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
1414
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
15-
"github.com/cosmos/cosmos-sdk/x/crisis"
1615
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
1716
"github.com/cosmos/cosmos-sdk/x/mint"
1817
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
@@ -73,10 +72,7 @@ func (s *KeeperTestSuite) SetupTest() {
7372
s.Require().NoError(err)
7473
}
7574

76-
func (s *KeeperTestSuite) TearDownTest() {
77-
// invariant check
78-
crisis.EndBlocker(s.ctx, *s.app.CrisisKeeper)
79-
}
75+
func (s *KeeperTestSuite) TearDownTest() {}
8076

8177
func (s *KeeperTestSuite) CreateValidators(powers []int64) ([]sdk.AccAddress, []sdk.ValAddress, []cryptotypes.PubKey) {
8278
_, err := s.app.BeginBlocker(s.ctx)

0 commit comments

Comments
 (0)