Skip to content

Commit 234cdc4

Browse files
authored
refactor(x/staking)!: removing unbonding queue index (#22795)
1 parent 2c2249f commit 234cdc4

27 files changed

+1127
-2508
lines changed

api/cosmos/staking/v1beta1/staking.pulsar.go

+205-201
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

simapp/sim_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ func TestAppImportExport(t *testing.T) {
100100
skipPrefixes := map[string][][]byte{
101101
stakingtypes.StoreKey: {
102102
stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey,
103-
stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, stakingtypes.UnbondingTypeKey,
104103
},
105104
authzkeeper.StoreKey: {authzkeeper.GrantQueuePrefix},
106105
feegrant.StoreKey: {feegrant.FeeAllowanceQueueKeyPrefix},

tests/integration/staking/keeper/deterministic_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ func TestGRPCValidatorUnbondingDelegations(t *testing.T) {
552552
ValidatorAddr: validator.OperatorAddress,
553553
}
554554

555-
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.ValidatorUnbondingDelegations, 3719, false)
555+
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.ValidatorUnbondingDelegations, 3707, false)
556556
}
557557

558558
func TestGRPCDelegation(t *testing.T) {
@@ -632,7 +632,7 @@ func TestGRPCUnbondingDelegation(t *testing.T) {
632632
DelegatorAddr: delegator1,
633633
}
634634

635-
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.UnbondingDelegation, 1621, false)
635+
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.UnbondingDelegation, 1615, false)
636636
}
637637

638638
func TestGRPCDelegatorDelegations(t *testing.T) {
@@ -755,7 +755,7 @@ func TestGRPCDelegatorUnbondingDelegations(t *testing.T) {
755755
DelegatorAddr: delegator1,
756756
}
757757

758-
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.DelegatorUnbondingDelegations, 1302, false)
758+
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.DelegatorUnbondingDelegations, 1290, false)
759759
}
760760

761761
func TestGRPCDelegatorValidators(t *testing.T) {
@@ -875,7 +875,7 @@ func TestGRPCRedelegations(t *testing.T) {
875875
DstValidatorAddr: validator2,
876876
}
877877

878-
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.Redelegations, 3926, false)
878+
testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.Redelegations, 3920, false)
879879
}
880880

881881
func TestGRPCParams(t *testing.T) {

tests/integration/staking/keeper/msg_server_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ func TestCancelUnbondingDelegation(t *testing.T) {
5858
delegatorAddr, validatorAddr, 10,
5959
ctx.HeaderInfo().Time.Add(time.Minute*10),
6060
unbondingAmount.Amount,
61-
0,
6261
address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"),
6362
)
6463

tests/integration/staking/keeper/slash_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestSlashUnbondingDelegation(t *testing.T) {
7979
// set an unbonding delegation with expiration timestamp (beyond which the
8080
// unbonding delegation shouldn't be slashed)
8181
ubd := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 0,
82-
time.Unix(5, 0), math.NewInt(10), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
82+
time.Unix(5, 0), math.NewInt(10), address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
8383

8484
assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd))
8585

@@ -138,7 +138,7 @@ func TestSlashRedelegation(t *testing.T) {
138138
// set a redelegation with an expiration timestamp beyond which the
139139
// redelegation shouldn't be slashed
140140
rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 0,
141-
time.Unix(5, 0), math.NewInt(10), math.LegacyNewDec(10), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
141+
time.Unix(5, 0), math.NewInt(10), math.LegacyNewDec(10), address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
142142

143143
assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rd))
144144

@@ -285,7 +285,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) {
285285
// set an unbonding delegation with expiration timestamp beyond which the
286286
// unbonding delegation shouldn't be slashed
287287
ubdTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 4)
288-
ubd := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 11, time.Unix(0, 0), ubdTokens, 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
288+
ubd := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 11, time.Unix(0, 0), ubdTokens, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
289289
assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubd))
290290

291291
// slash validator for the first time
@@ -415,7 +415,7 @@ func TestSlashWithRedelegation(t *testing.T) {
415415

416416
// set a redelegation
417417
rdTokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 6)
418-
rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdTokens, math.LegacyNewDecFromInt(rdTokens), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
418+
rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdTokens, math.LegacyNewDecFromInt(rdTokens), address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
419419
assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rd))
420420

421421
// set the associated delegation
@@ -573,7 +573,7 @@ func TestSlashBoth(t *testing.T) {
573573
// set a redelegation with expiration timestamp beyond which the
574574
// redelegation shouldn't be slashed
575575
rdATokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 6)
576-
rdA := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdATokens, math.LegacyNewDecFromInt(rdATokens), 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
576+
rdA := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdATokens, math.LegacyNewDecFromInt(rdATokens), address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
577577
assert.NilError(t, f.stakingKeeper.SetRedelegation(f.sdkCtx, rdA))
578578

579579
// set the associated delegation
@@ -584,7 +584,7 @@ func TestSlashBoth(t *testing.T) {
584584
// unbonding delegation shouldn't be slashed)
585585
ubdATokens := f.stakingKeeper.TokensFromConsensusPower(f.sdkCtx, 4)
586586
ubdA := types.NewUnbondingDelegation(addrDels[0], addrVals[0], 11,
587-
time.Unix(0, 0), ubdATokens, 0, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
587+
time.Unix(0, 0), ubdATokens, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"))
588588
assert.NilError(t, f.stakingKeeper.SetUnbondingDelegation(f.sdkCtx, ubdA))
589589

590590
bondedCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, rdATokens.MulRaw(2)))

0 commit comments

Comments
 (0)