diff --git a/x/slashing/keeper_test.go b/x/slashing/keeper_test.go index dd4bb4cd6..7c7be34e8 100644 --- a/x/slashing/keeper_test.go +++ b/x/slashing/keeper_test.go @@ -120,6 +120,8 @@ func TestHandleAbsentValidator(t *testing.T) { // should be bonded still validator := sk.ValidatorByPubKey(ctx, val) require.Equal(t, sdk.Bonded, validator.GetStatus()) + pool := sk.GetPool(ctx) + require.Equal(t, int64(210), pool.BondedTokens) // 51st block missed ctx = ctx.WithBlockHeight(height) keeper.handleValidatorSignature(ctx, val, false) @@ -138,8 +140,9 @@ func TestHandleAbsentValidator(t *testing.T) { require.True(t, got.IsOK()) // should succeed after jail expiration validator = sk.ValidatorByPubKey(ctx, val) require.Equal(t, sdk.Bonded, validator.GetStatus()) + pool = sk.GetPool(ctx) // should have been slashed - require.Equal(t, sdk.NewRat(amt).Mul(sdk.NewRat(99).Quo(sdk.NewRat(100))), sk.Validator(ctx, addr).GetPower()) + require.Equal(t, int64(208), pool.BondedTokens) } func newPubKey(pk string) (res crypto.PubKey) { diff --git a/x/stake/keeper.go b/x/stake/keeper.go index 887cdab19..e8ac6947c 100644 --- a/x/stake/keeper.go +++ b/x/stake/keeper.go @@ -220,9 +220,7 @@ func (k Keeper) updateValidator(ctx sdk.Context, validator Validator) Validator oldValidator, oldFound := k.GetValidator(ctx, ownerAddr) if validator.Revoked && oldValidator.Status() == sdk.Bonded { - fmt.Printf("val preupdate: %v\n", validator) validator, pool = validator.UpdateStatus(pool, sdk.Unbonded) - fmt.Printf("val postupdate: %v\n", validator) k.setPool(ctx, pool) }