From 034163c021ac1e6d6150d92b8c944b769aec7ec5 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Fri, 5 Oct 2018 14:58:19 +0200 Subject: [PATCH] Minor fixes --- Makefile | 2 +- x/slashing/keeper_test.go | 2 ++ x/slashing/slashing_period.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e5a784771..5225076fa 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,7 @@ test_sim_gaia_fast: test_sim_gaia_multi_seed: @echo "Running multi-seed Gaia simulation. This may take awhile!" - @sh scripts/multisim.sh 10 + @bash scripts/multisim.sh 10 SIM_NUM_BLOCKS ?= 210 SIM_BLOCK_SIZE ?= 200 diff --git a/x/slashing/keeper_test.go b/x/slashing/keeper_test.go index a3191d6e1..ef5d0ad26 100644 --- a/x/slashing/keeper_test.go +++ b/x/slashing/keeper_test.go @@ -26,6 +26,8 @@ func TestHandleDoubleSign(t *testing.T) { // initial setup ctx, ck, sk, _, keeper := createTestInput(t) + // validator added pre-genesis + ctx = ctx.WithBlockHeight(-1) sk = sk.WithHooks(keeper.Hooks()) amtInt := int64(100) operatorAddr, val, amt := addrs[0], pks[0], sdk.NewInt(amtInt) diff --git a/x/slashing/slashing_period.go b/x/slashing/slashing_period.go index fc57e663a..923cac44c 100644 --- a/x/slashing/slashing_period.go +++ b/x/slashing/slashing_period.go @@ -68,7 +68,7 @@ func (k Keeper) unmarshalSlashingPeriodKeyValue(key []byte, value []byte) Valida var slashingPeriodValue ValidatorSlashingPeriodValue k.cdc.MustUnmarshalBinary(value, &slashingPeriodValue) address := sdk.ConsAddress(key[1 : 1+sdk.AddrLen]) - startHeight := int64(binary.LittleEndian.Uint64(key[1+sdk.AddrLen : 1+sdk.AddrLen+8])) + startHeight := int64(binary.LittleEndian.Uint64(key[1+sdk.AddrLen:1+sdk.AddrLen+8]) - 1) return ValidatorSlashingPeriod{ ValidatorAddr: address, StartHeight: startHeight,