Merge PR #2205: minor develop fix

* minor corrections

* ...

* ...
This commit is contained in:
Rigel 2018-08-31 21:23:30 -04:00 committed by GitHub
parent 1204857694
commit b296209536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -38,7 +38,9 @@ func TestJailedValidatorDelegations(t *testing.T) {
// create a validator // create a validator
amount := int64(10) amount := int64(10)
valAddr, valPubKey, bondAmount := sdk.ValAddress(addrs[0]), pks[0], sdk.NewInt(amount) valPubKey, bondAmount := pks[0], sdk.NewInt(amount)
valAddr, consAddr := sdk.ValAddress(addrs[1]), sdk.ConsAddress(addrs[0])
msgCreateVal := newTestMsgCreateValidator(valAddr, valPubKey, bondAmount) msgCreateVal := newTestMsgCreateValidator(valAddr, valPubKey, bondAmount)
got := stake.NewHandler(stakeKeeper)(ctx, msgCreateVal) got := stake.NewHandler(stakeKeeper)(ctx, msgCreateVal)
require.True(t, got.IsOK(), "expected create validator msg to be ok, got: %v", got) require.True(t, got.IsOK(), "expected create validator msg to be ok, got: %v", got)
@ -50,10 +52,10 @@ func TestJailedValidatorDelegations(t *testing.T) {
JailedUntil: time.Unix(0, 0), JailedUntil: time.Unix(0, 0),
SignedBlocksCounter: int64(0), SignedBlocksCounter: int64(0),
} }
slashingKeeper.setValidatorSigningInfo(ctx, valAddr, newInfo) slashingKeeper.setValidatorSigningInfo(ctx, consAddr, newInfo)
// delegate tokens to the validator // delegate tokens to the validator
delAddr := addrs[1] delAddr := sdk.AccAddress(addrs[2])
msgDelegate := newTestMsgDelegate(delAddr, valAddr, bondAmount) msgDelegate := newTestMsgDelegate(delAddr, valAddr, bondAmount)
got = stake.NewHandler(stakeKeeper)(ctx, msgDelegate) got = stake.NewHandler(stakeKeeper)(ctx, msgDelegate)
require.True(t, got.IsOK(), "expected delegation to be ok, got %v", got) require.True(t, got.IsOK(), "expected delegation to be ok, got %v", got)