Address a few style comments

This commit is contained in:
Christopher Goes 2018-05-31 01:37:38 +02:00
parent f5f53c0a8d
commit 604fd4c9a7
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
2 changed files with 7 additions and 7 deletions

View File

@ -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())

View File

@ -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
}