add helper to UpdateBondedValidatorsFull
This commit is contained in:
parent
1433b61a92
commit
2a419a3192
|
@ -342,6 +342,7 @@ func checkValidatorSetup(t *testing.T, pool types.Pool, initialTotalTokens, init
|
|||
}
|
||||
|
||||
// Checks that The inflation will correctly increase or decrease after an update to the pool
|
||||
// nolint: gocyclo
|
||||
func checkInflation(t *testing.T, pool types.Pool, previousInflation, updatedInflation sdk.Rat, msg string) {
|
||||
inflationChange := updatedInflation.Sub(previousInflation)
|
||||
|
||||
|
|
|
@ -422,6 +422,11 @@ func (k Keeper) UpdateBondedValidatorsFull(ctx sdk.Context) {
|
|||
iterator.Close()
|
||||
|
||||
// perform the actual kicks
|
||||
kickOutValidators(k, ctx, toKickOut)
|
||||
return
|
||||
}
|
||||
|
||||
func kickOutValidators(k Keeper, ctx sdk.Context, toKickOut map[string]byte) {
|
||||
for key := range toKickOut {
|
||||
ownerAddr := []byte(key)
|
||||
validator, found := k.GetValidator(ctx, ownerAddr)
|
||||
|
@ -430,7 +435,6 @@ func (k Keeper) UpdateBondedValidatorsFull(ctx sdk.Context) {
|
|||
}
|
||||
k.unbondValidator(ctx, validator)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// perform all the store operations for when a validator status becomes unbonded
|
||||
|
|
Loading…
Reference in New Issue