Address a few style comments
This commit is contained in:
parent
f5f53c0a8d
commit
604fd4c9a7
|
@ -16,7 +16,7 @@ func TestHandleDoubleSign(t *testing.T) {
|
|||
addr, val, amt := addrs[0], pks[0], int64(100)
|
||||
got := stake.NewHandler(sk)(ctx, newTestMsgDeclareCandidacy(addr, val, amt))
|
||||
require.True(t, got.IsOK())
|
||||
_ = sk.Tick(ctx)
|
||||
sk.Tick(ctx)
|
||||
require.Equal(t, ck.GetCoins(ctx, addr), sdk.Coins{{sk.GetParams(ctx).BondDenom, initCoins - amt}})
|
||||
require.Equal(t, sdk.NewRat(amt), sk.Validator(ctx, addr).GetPower())
|
||||
keeper.handleDoubleSign(ctx, 0, 0, val) // double sign less than max age
|
||||
|
@ -33,7 +33,7 @@ func TestHandleAbsentValidator(t *testing.T) {
|
|||
slh := NewHandler(keeper)
|
||||
got := sh(ctx, newTestMsgDeclareCandidacy(addr, val, amt))
|
||||
require.True(t, got.IsOK())
|
||||
_ = sk.Tick(ctx)
|
||||
sk.Tick(ctx)
|
||||
require.Equal(t, ck.GetCoins(ctx, addr), sdk.Coins{{sk.GetParams(ctx).BondDenom, initCoins - amt}})
|
||||
require.Equal(t, sdk.NewRat(amt), sk.Validator(ctx, addr).GetPower())
|
||||
info, found := keeper.getValidatorSigningInfo(ctx, val.Address())
|
||||
|
|
|
@ -12,10 +12,10 @@ func (k Keeper) getValidatorSigningInfo(ctx sdk.Context, address sdk.Address) (i
|
|||
bz := store.Get(validatorSigningInfoKey(address))
|
||||
if bz == nil {
|
||||
found = false
|
||||
} else {
|
||||
k.cdc.MustUnmarshalBinary(bz, &info)
|
||||
found = true
|
||||
return
|
||||
}
|
||||
k.cdc.MustUnmarshalBinary(bz, &info)
|
||||
found = true
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,9 @@ func (k Keeper) getValidatorSigningBitArray(ctx sdk.Context, address sdk.Address
|
|||
if bz == nil {
|
||||
// lazy: treat empty key as unsigned
|
||||
signed = false
|
||||
} else {
|
||||
k.cdc.MustUnmarshalBinary(bz, &signed)
|
||||
return
|
||||
}
|
||||
k.cdc.MustUnmarshalBinary(bz, &signed)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue