chore: gofumpt (#11839)
* fumpt using main not master... * be more descriptive * fumpt * fix nits Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Julien Robert
parent
bc2d553f77
commit
55054282d2
@@ -30,7 +30,6 @@ func GetQueryCmd() *cobra.Command {
|
||||
)
|
||||
|
||||
return slashingQueryCmd
|
||||
|
||||
}
|
||||
|
||||
// GetCmdQuerySigningInfo implements the command to query signing info.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build norace
|
||||
// +build norace
|
||||
|
||||
package testutil
|
||||
|
||||
@@ -4,7 +4,5 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
var (
|
||||
// The default power validators are initialized to have within tests
|
||||
InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction)
|
||||
)
|
||||
// The default power validators are initialized to have within tests
|
||||
var InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction)
|
||||
|
||||
@@ -2,7 +2,5 @@ package keeper_test
|
||||
|
||||
import sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
var (
|
||||
// The default power validators are initialized to have within tests
|
||||
InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction)
|
||||
)
|
||||
// The default power validators are initialized to have within tests
|
||||
var InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction)
|
||||
|
||||
@@ -91,7 +91,7 @@ func (suite *SlashingTestSuite) TestGRPCSigningInfos() {
|
||||
})
|
||||
|
||||
// verify all values are returned without pagination
|
||||
var infoResp, err = queryClient.SigningInfos(gocontext.Background(),
|
||||
infoResp, err := queryClient.SigningInfos(gocontext.Background(),
|
||||
&types.QuerySigningInfosRequest{Pagination: nil})
|
||||
suite.NoError(err)
|
||||
suite.Equal(signingInfos, infoResp.Info)
|
||||
|
||||
@@ -179,7 +179,6 @@ func TestHandleAlreadyJailed(t *testing.T) {
|
||||
// Ensure that missed blocks are tracked correctly and that
|
||||
// the start height of the signing info is reset correctly
|
||||
func TestValidatorDippingInAndOut(t *testing.T) {
|
||||
|
||||
// initial setup
|
||||
// TestParams set the SignedBlocksWindow to 1000 and MaxMissedBlocksPerWindow to 500
|
||||
app := simapp.Setup(t, false)
|
||||
|
||||
@@ -39,8 +39,8 @@ func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress
|
||||
|
||||
// IterateValidatorSigningInfos iterates over the stored ValidatorSigningInfo
|
||||
func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context,
|
||||
handler func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool)) {
|
||||
|
||||
handler func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool),
|
||||
) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
iter := sdk.KVStorePrefixIterator(store, types.ValidatorSigningInfoKeyPrefix)
|
||||
defer iter.Close()
|
||||
@@ -71,8 +71,8 @@ func (k Keeper) GetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.Con
|
||||
// IterateValidatorMissedBlockBitArray iterates over the signed blocks window
|
||||
// and performs a callback function
|
||||
func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context,
|
||||
address sdk.ConsAddress, handler func(index int64, missed bool) (stop bool)) {
|
||||
|
||||
address sdk.ConsAddress, handler func(index int64, missed bool) (stop bool),
|
||||
) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
index := int64(0)
|
||||
// Array may be sparse
|
||||
|
||||
@@ -53,7 +53,6 @@ func TestRandomizedGenState(t *testing.T) {
|
||||
require.Equal(t, time.Duration(34800000000000), slashingGenesis.Params.DowntimeJailDuration)
|
||||
require.Len(t, slashingGenesis.MissedBlocks, 0)
|
||||
require.Len(t, slashingGenesis.SigningInfos, 0)
|
||||
|
||||
}
|
||||
|
||||
// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState.
|
||||
|
||||
@@ -26,7 +26,6 @@ func WeightedOperations(
|
||||
appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper,
|
||||
bk types.BankKeeper, k keeper.Keeper, sk stakingkeeper.Keeper,
|
||||
) simulation.WeightedOperations {
|
||||
|
||||
var weightMsgUnjail int
|
||||
appParams.GetOrGenerate(cdc, OpWeightMsgUnjail, &weightMsgUnjail, nil,
|
||||
func(_ *rand.Rand) {
|
||||
@@ -48,7 +47,6 @@ func SimulateMsgUnjail(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Kee
|
||||
r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context,
|
||||
accs []simtypes.Account, chainID string,
|
||||
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
|
||||
|
||||
validator, ok := stakingkeeper.RandomValidator(r, sk, ctx)
|
||||
if !ok {
|
||||
return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUnjail, "validator is not ok"), nil, nil // skip
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
func NewGenesisState(
|
||||
params Params, signingInfos []SigningInfo, missedBlocks []ValidatorMissedBlocks,
|
||||
) *GenesisState {
|
||||
|
||||
return &GenesisState{
|
||||
Params: params,
|
||||
SigningInfos: signingInfos,
|
||||
|
||||
@@ -39,7 +39,6 @@ func NewParams(
|
||||
signedBlocksWindow int64, minSignedPerWindow sdk.Dec, downtimeJailDuration time.Duration,
|
||||
slashFractionDoubleSign, slashFractionDowntime sdk.Dec,
|
||||
) Params {
|
||||
|
||||
return Params{
|
||||
SignedBlocksWindow: signedBlocksWindow,
|
||||
MinSignedPerWindow: minSignedPerWindow,
|
||||
|
||||
@@ -14,7 +14,6 @@ func NewValidatorSigningInfo(
|
||||
condAddr sdk.ConsAddress, startHeight, indexOffset int64,
|
||||
jailedUntil time.Time, tombstoned bool, missedBlocksCounter int64,
|
||||
) ValidatorSigningInfo {
|
||||
|
||||
return ValidatorSigningInfo{
|
||||
Address: condAddr.String(),
|
||||
StartHeight: startHeight,
|
||||
|
||||
Reference in New Issue
Block a user