From 07ba719c752fb3a746470fe342044861ee52c1e3 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Fri, 31 Aug 2018 20:50:12 -0400 Subject: [PATCH 1/3] minor corrections --- x/slashing/handler_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/slashing/handler_test.go b/x/slashing/handler_test.go index 2ba8dcc4db9b..748164ebbeda 100644 --- a/x/slashing/handler_test.go +++ b/x/slashing/handler_test.go @@ -50,10 +50,11 @@ func TestJailedValidatorDelegations(t *testing.T) { JailedUntil: time.Unix(0, 0), SignedBlocksCounter: int64(0), } - slashingKeeper.setValidatorSigningInfo(ctx, valAddr, newInfo) + consAddr := sdk.ConsAddress(valAddr.Bytes()) + slashingKeeper.setValidatorSigningInfo(ctx, consAddr, newInfo) // delegate tokens to the validator - delAddr := addrs[1] + delAddr := sdk.AccAddress(addrs[1]) msgDelegate := newTestMsgDelegate(delAddr, valAddr, bondAmount) got = stake.NewHandler(stakeKeeper)(ctx, msgDelegate) require.True(t, got.IsOK(), "expected delegation to be ok, got %v", got) From 9593a2641ae15e93a12df4a70a3500201219a98a Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Fri, 31 Aug 2018 20:52:45 -0400 Subject: [PATCH 2/3] ... --- x/slashing/handler_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x/slashing/handler_test.go b/x/slashing/handler_test.go index 748164ebbeda..67139a06ecb3 100644 --- a/x/slashing/handler_test.go +++ b/x/slashing/handler_test.go @@ -38,7 +38,9 @@ func TestJailedValidatorDelegations(t *testing.T) { // create a validator amount := int64(10) - valAddr, valPubKey, bondAmount := sdk.ValAddress(addrs[0]), pks[0], sdk.NewInt(amount) + valPubKey, bondAmount := pks[0], sdk.NewInt(amount) + consAddr, valAddr := sdk.ConsAddress(addrs[0]), sdk.ValAddress(addrs[1]) + msgCreateVal := newTestMsgCreateValidator(valAddr, valPubKey, bondAmount) got := stake.NewHandler(stakeKeeper)(ctx, msgCreateVal) require.True(t, got.IsOK(), "expected create validator msg to be ok, got: %v", got) @@ -50,11 +52,10 @@ func TestJailedValidatorDelegations(t *testing.T) { JailedUntil: time.Unix(0, 0), SignedBlocksCounter: int64(0), } - consAddr := sdk.ConsAddress(valAddr.Bytes()) slashingKeeper.setValidatorSigningInfo(ctx, consAddr, newInfo) // delegate tokens to the validator - delAddr := sdk.AccAddress(addrs[1]) + delAddr := sdk.AccAddress(addrs[2]) msgDelegate := newTestMsgDelegate(delAddr, valAddr, bondAmount) got = stake.NewHandler(stakeKeeper)(ctx, msgDelegate) require.True(t, got.IsOK(), "expected delegation to be ok, got %v", got) From 6e295085c191a92ed8ac87421bc7071c8701e205 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Fri, 31 Aug 2018 20:56:35 -0400 Subject: [PATCH 3/3] ... --- x/slashing/handler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/slashing/handler_test.go b/x/slashing/handler_test.go index 67139a06ecb3..c5afb87389df 100644 --- a/x/slashing/handler_test.go +++ b/x/slashing/handler_test.go @@ -39,7 +39,7 @@ func TestJailedValidatorDelegations(t *testing.T) { // create a validator amount := int64(10) valPubKey, bondAmount := pks[0], sdk.NewInt(amount) - consAddr, valAddr := sdk.ConsAddress(addrs[0]), sdk.ValAddress(addrs[1]) + valAddr, consAddr := sdk.ValAddress(addrs[1]), sdk.ConsAddress(addrs[0]) msgCreateVal := newTestMsgCreateValidator(valAddr, valPubKey, bondAmount) got := stake.NewHandler(stakeKeeper)(ctx, msgCreateVal)