From a86fcdc88f8c2e79f1906b6407dd6dde16717054 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 25 Jul 2018 16:24:41 -0700 Subject: [PATCH] Fix slashing test to reflect SlashFractionDowntime param --- x/slashing/keeper_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/slashing/keeper_test.go b/x/slashing/keeper_test.go index 794bc2c92c..6d1e52e28f 100644 --- a/x/slashing/keeper_test.go +++ b/x/slashing/keeper_test.go @@ -129,7 +129,8 @@ func TestHandleAbsentValidator(t *testing.T) { // validator should have been slashed pool = sk.GetPool(ctx) - require.Equal(t, int64(amtInt-1), pool.BondedTokens.RoundInt64()) + slashAmt := sdk.NewRat(amtInt).Mul(SlashFractionDowntime).RoundInt64() + require.Equal(t, int64(amtInt)-slashAmt, pool.BondedTokens.RoundInt64()) // validator start height should have been changed info, found = keeper.getValidatorSigningInfo(ctx, sdk.ValAddress(val.Address()))