Skip to content

Commit b9d379d

Browse files
authored
Merge branch 'main' into dependabot/github_actions/docker/login-action-3
2 parents 6662f30 + 4651a51 commit b9d379d

File tree

10 files changed

+84
-97
lines changed

10 files changed

+84
-97
lines changed

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
}

proto/pstake/liquidstake/v1beta1/liquidstake.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ message Params {
2424
// UnstakeFeeRate specifies the fee rate when liquid unstake is requested,
2525
// unbonded by subtracting it from unbondingAmount
2626
string unstake_fee_rate = 3 [
27+
(cosmos_proto.scalar) = "cosmos.Dec",
2728
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
2829
(gogoproto.nullable) = false
2930
];
@@ -54,6 +55,7 @@ message Params {
5455
// rewards. The fee is taken in favour of the fee account (see
5556
// FeeAccountAddress).
5657
string autocompound_fee_rate = 8 [
58+
(cosmos_proto.scalar) = "cosmos.Dec",
5759
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
5860
(gogoproto.nullable) = false
5961
];
@@ -141,8 +143,9 @@ message LiquidValidatorState {
141143

142144
// del_shares define the delegation shares of the validator
143145
string del_shares = 4 [
146+
(cosmos_proto.scalar) = "cosmos.Dec",
144147
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
145-
(gogoproto.nullable) = false
148+
(gogoproto.nullable) = false
146149
];
147150

148151
// liquid_tokens define the token amount worth of delegation shares of the
@@ -162,6 +165,7 @@ message NetAmountState {
162165

163166
// mint_rate is stkXPRTTotalSupply / NetAmount
164167
string mint_rate = 1 [
168+
(cosmos_proto.scalar) = "cosmos.Dec",
165169
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
166170
(gogoproto.nullable) = false
167171
];
@@ -175,12 +179,14 @@ message NetAmountState {
175179
// net_amount is proxy account's native token balance + total liquid tokens +
176180
// total remaining rewards + total unbonding balance
177181
string net_amount = 3 [
182+
(cosmos_proto.scalar) = "cosmos.Dec",
178183
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
179184
(gogoproto.nullable) = false
180185
];
181186

182187
// total_del_shares define the delegation shares of all liquid validators
183188
string total_del_shares = 4 [
189+
(cosmos_proto.scalar) = "cosmos.Dec",
184190
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
185191
(gogoproto.nullable) = false
186192
];
@@ -195,6 +201,7 @@ message NetAmountState {
195201
// total_remaining_rewards define the sum of remaining rewards of proxy
196202
// account by all liquid validators
197203
string total_remaining_rewards = 6 [
204+
(cosmos_proto.scalar) = "cosmos.Dec",
198205
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
199206
(gogoproto.nullable) = false
200207
];

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)