address cwgoes comments
This commit is contained in:
parent
f08f02d67d
commit
d36dda0267
|
@ -303,7 +303,7 @@ func (k Keeper) UpdateBondedValidators(ctx sdk.Context,
|
||||||
// TODO benchmark if we should read the current power and not write if it's the same
|
// TODO benchmark if we should read the current power and not write if it's the same
|
||||||
if bondedValidatorsCount == int(maxValidators) { // is cliff validator
|
if bondedValidatorsCount == int(maxValidators) { // is cliff validator
|
||||||
k.setCliffValidator(ctx, validator, k.GetPool(ctx))
|
k.setCliffValidator(ctx, validator, k.GetPool(ctx))
|
||||||
} else {
|
} else if len(oldCliffValidatorAddr) > 0 {
|
||||||
k.clearCliffValidator(ctx)
|
k.clearCliffValidator(ctx)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
@ -409,10 +409,14 @@ func (k Keeper) UpdateBondedValidatorsFull(ctx sdk.Context) {
|
||||||
validator = k.bondValidator(ctx, validator)
|
validator = k.bondValidator(ctx, validator)
|
||||||
}
|
}
|
||||||
|
|
||||||
if validator.Revoked && validator.Status() == sdk.Bonded {
|
if !validator.Revoked {
|
||||||
panic(fmt.Sprintf("revoked validator cannot be bonded, address: %v\n", ownerAddr))
|
bondedValidatorsCount++
|
||||||
|
} else {
|
||||||
|
if validator.Status() == sdk.Bonded {
|
||||||
|
panic(fmt.Sprintf("revoked validator cannot be bonded, address: %v\n", ownerAddr))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bondedValidatorsCount++
|
|
||||||
iterator.Next()
|
iterator.Next()
|
||||||
}
|
}
|
||||||
iterator.Close()
|
iterator.Close()
|
||||||
|
|
|
@ -634,8 +634,7 @@ func TestGetTendermintUpdatesInserted(t *testing.T) {
|
||||||
require.Equal(t, validators[4].ABCIValidator(), updates[0])
|
require.Equal(t, validators[4].ABCIValidator(), updates[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO why is this called NotValidatorCliff?
|
func TestGetTendermintUpdatesWithCliffValidator(t *testing.T) {
|
||||||
func TestGetTendermintUpdatesNotValidatorCliff(t *testing.T) {
|
|
||||||
ctx, _, keeper := CreateTestInput(t, false, 1000)
|
ctx, _, keeper := CreateTestInput(t, false, 1000)
|
||||||
params := types.DefaultParams()
|
params := types.DefaultParams()
|
||||||
params.MaxValidators = 2
|
params.MaxValidators = 2
|
||||||
|
|
Loading…
Reference in New Issue