parent
1204857694
commit
b296209536
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue