diff --git a/app/setup_handlers.go b/app/setup_handlers.go index d9119ee8f6..46c78a3f13 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -12,7 +12,7 @@ import ( const releaseVersion = "v15" func SetupHandlers(app *App) { - app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) { + app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, _ types.Plan, vm module.VersionMap) (module.VersionMap, error) { app.Logger().Info("Running upgrade handler for " + releaseVersion) // Updated version map to the latest consensus versions from each module for m, mb := range app.mm.Modules { diff --git a/cmd/zetaclientd/debug.go b/cmd/zetaclientd/debug.go index 32cb32c772..e0f162793d 100644 --- a/cmd/zetaclientd/debug.go +++ b/cmd/zetaclientd/debug.go @@ -47,7 +47,7 @@ func DebugCmd() *cobra.Command { cmd := &cobra.Command{ Use: "get-ballot-from-intx [txHash] [chainID]", Short: "provide txHash and chainID to get the ballot status for the txHash", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { cobra.ExactArgs(2) cfg, err := config.Load(debugArgs.zetaCoreHome) if err != nil { diff --git a/cmd/zetacored/addr_converter.go b/cmd/zetacored/addr_converter.go index 63d66e6f86..557b4cc9c2 100644 --- a/cmd/zetacored/addr_converter.go +++ b/cmd/zetacored/addr_converter.go @@ -18,7 +18,7 @@ it always outputs three lines; the first line is the zeta1xxx address, the secon and the third line is the ethereum address. `, Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { addr, err := sdk.AccAddressFromBech32(args[0]) if err == nil { valAddr := sdk.ValAddress(addr.Bytes()) diff --git a/cmd/zetacored/collect_observer_info.go b/cmd/zetacored/collect_observer_info.go index f9c351636c..420b82eb6e 100644 --- a/cmd/zetacored/collect_observer_info.go +++ b/cmd/zetacored/collect_observer_info.go @@ -14,7 +14,7 @@ func CollectObserverInfoCmd() *cobra.Command { Use: "collect-observer-info [folder]", Short: "collect observer info from a folder , default path is ~/.zetacored/os_info/ \n", Args: cobra.MaximumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { defaultHome := app.DefaultNodeHome defaultFile := filepath.Join(defaultHome, "os_info") if len(args) == 0 { diff --git a/cmd/zetacored/parse_genesis.go b/cmd/zetacored/parse_genesis.go index ff752a9ddc..24631d54c3 100644 --- a/cmd/zetacored/parse_genesis.go +++ b/cmd/zetacored/parse_genesis.go @@ -35,7 +35,7 @@ import ( observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) -const Max_items_for_list = 10 +const MaxItemsForList = 10 var Copy = map[string]bool{ slashingtypes.ModuleName: true, @@ -78,8 +78,13 @@ func CmdParseGenesisFile() *cobra.Command { genesisFilePath = args[1] } genDoc, err := GetGenDoc(genesisFilePath) + if err != nil { + return err + } importData, err := GetGenDoc(args[0]) - + if err != nil { + return err + } err = ImportDataIntoFile(genDoc, importData, cdc) if err != nil { return err @@ -143,9 +148,9 @@ func ImportDataIntoFile(genDoc *types.GenesisDoc, importFile *types.GenesisDoc, func ModifyCrossChainState(appState map[string]json.RawMessage, importAppState map[string]json.RawMessage, cdc codec.Codec) error { importedCrossChainGenState := crosschaintypes.GetGenesisStateFromAppState(cdc, importAppState) - importedCrossChainGenState.CrossChainTxs = importedCrossChainGenState.CrossChainTxs[:math.Min(Max_items_for_list, len(importedCrossChainGenState.CrossChainTxs))] - importedCrossChainGenState.InTxHashToCctxList = importedCrossChainGenState.InTxHashToCctxList[:math.Min(Max_items_for_list, len(importedCrossChainGenState.InTxHashToCctxList))] - importedCrossChainGenState.FinalizedInbounds = importedCrossChainGenState.FinalizedInbounds[:math.Min(Max_items_for_list, len(importedCrossChainGenState.FinalizedInbounds))] + importedCrossChainGenState.CrossChainTxs = importedCrossChainGenState.CrossChainTxs[:math.Min(MaxItemsForList, len(importedCrossChainGenState.CrossChainTxs))] + importedCrossChainGenState.InTxHashToCctxList = importedCrossChainGenState.InTxHashToCctxList[:math.Min(MaxItemsForList, len(importedCrossChainGenState.InTxHashToCctxList))] + importedCrossChainGenState.FinalizedInbounds = importedCrossChainGenState.FinalizedInbounds[:math.Min(MaxItemsForList, len(importedCrossChainGenState.FinalizedInbounds))] importedCrossChainStateBz, err := json.Marshal(importedCrossChainGenState) if err != nil { return fmt.Errorf("failed to marshal zetacrosschain genesis state: %w", err) @@ -156,8 +161,8 @@ func ModifyCrossChainState(appState map[string]json.RawMessage, importAppState m func ModifyObserverState(appState map[string]json.RawMessage, importAppState map[string]json.RawMessage, cdc codec.Codec) error { importedObserverGenState := observertypes.GetGenesisStateFromAppState(cdc, importAppState) - importedObserverGenState.Ballots = importedObserverGenState.Ballots[:math.Min(Max_items_for_list, len(importedObserverGenState.Ballots))] - importedObserverGenState.NonceToCctx = importedObserverGenState.NonceToCctx[:math.Min(Max_items_for_list, len(importedObserverGenState.NonceToCctx))] + importedObserverGenState.Ballots = importedObserverGenState.Ballots[:math.Min(MaxItemsForList, len(importedObserverGenState.Ballots))] + importedObserverGenState.NonceToCctx = importedObserverGenState.NonceToCctx[:math.Min(MaxItemsForList, len(importedObserverGenState.NonceToCctx))] currentGenState := observertypes.GetGenesisStateFromAppState(cdc, appState) currentGenState.Ballots = importedObserverGenState.Ballots diff --git a/cmd/zetacored/parse_genesis_test.go b/cmd/zetacored/parse_genesis_test.go index 3c51a2da04..469b57c0ba 100644 --- a/cmd/zetacored/parse_genesis_test.go +++ b/cmd/zetacored/parse_genesis_test.go @@ -72,8 +72,8 @@ func Test_ModifyObserverState(t *testing.T) { require.NoError(t, err) modifiedObserverAppState := observertypes.GetGenesisStateFromAppState(cdc, appState) - require.Len(t, modifiedObserverAppState.Ballots, zetacored.Max_items_for_list) - require.Len(t, modifiedObserverAppState.NonceToCctx, zetacored.Max_items_for_list) + require.Len(t, modifiedObserverAppState.Ballots, zetacored.MaxItemsForList) + require.Len(t, modifiedObserverAppState.NonceToCctx, zetacored.MaxItemsForList) }) t.Run("successfully modify observer state without changing data when not needed", func(t *testing.T) { @@ -104,9 +104,9 @@ func Test_ImportDataIntoFile(t *testing.T) { // Crosschain module is in Modify list crosschainStateAfterImport := crosschaintypes.GetGenesisStateFromAppState(cdc, appState) - require.Len(t, crosschainStateAfterImport.CrossChainTxs, zetacored.Max_items_for_list) - require.Len(t, crosschainStateAfterImport.InTxHashToCctxList, zetacored.Max_items_for_list) - require.Len(t, crosschainStateAfterImport.FinalizedInbounds, zetacored.Max_items_for_list) + require.Len(t, crosschainStateAfterImport.CrossChainTxs, zetacored.MaxItemsForList) + require.Len(t, crosschainStateAfterImport.InTxHashToCctxList, zetacored.MaxItemsForList) + require.Len(t, crosschainStateAfterImport.FinalizedInbounds, zetacored.MaxItemsForList) // Bank module is in Skip list var bankStateAfterImport banktypes.GenesisState diff --git a/docs/openapi/openapi.go b/docs/openapi/openapi.go index 11f4e40b72..187dbbe7ce 100644 --- a/docs/openapi/openapi.go +++ b/docs/openapi/openapi.go @@ -30,7 +30,7 @@ func openAPIHandler() http.HandlerFunc { panic(err) } - return func(w http.ResponseWriter, req *http.Request) { + return func(w http.ResponseWriter, _ *http.Request) { err := tmpl.Execute(w, struct { URL string }{ diff --git a/rpc/websockets.go b/rpc/websockets.go index 3c64bfdb8a..0eec84127e 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -148,7 +148,7 @@ func (s *websocketsServer) Start() { func (s *websocketsServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { upgrader := websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { + CheckOrigin: func(_ *http.Request) bool { return true }, } diff --git a/x/authority/client/cli/query_policies.go b/x/authority/client/cli/query_policies.go index 66ad4e5644..723dfcf71b 100644 --- a/x/authority/client/cli/query_policies.go +++ b/x/authority/client/cli/query_policies.go @@ -15,7 +15,7 @@ func CmdShowPolicies() *cobra.Command { Use: "show-policies", Short: "show the policies", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/crosschain/client/cli/cli_cctx.go b/x/crosschain/client/cli/cli_cctx.go index 87991442d1..d28955a1a7 100644 --- a/x/crosschain/client/cli/cli_cctx.go +++ b/x/crosschain/client/cli/cli_cctx.go @@ -21,7 +21,7 @@ func CmdListSend() *cobra.Command { cmd := &cobra.Command{ Use: "list-cctx", Short: "list all CCTX", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/crosschain/client/cli/cli_gas_price.go b/x/crosschain/client/cli/cli_gas_price.go index b46897b36c..b080aa7809 100644 --- a/x/crosschain/client/cli/cli_gas_price.go +++ b/x/crosschain/client/cli/cli_gas_price.go @@ -15,7 +15,7 @@ func CmdListGasPrice() *cobra.Command { cmd := &cobra.Command{ Use: "list-gas-price", Short: "list all gasPrice", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/crosschain/client/cli/cli_in_tx_tracker.go b/x/crosschain/client/cli/cli_in_tx_tracker.go index 5afcec7ec8..d31257a257 100644 --- a/x/crosschain/client/cli/cli_in_tx_tracker.go +++ b/x/crosschain/client/cli/cli_in_tx_tracker.go @@ -86,7 +86,7 @@ func CmdListInTxTrackers() *cobra.Command { Use: "list-all-in-tx-trackers", Short: "shows all inTxTrackers", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) params := &types.QueryAllInTxTrackersRequest{} diff --git a/x/crosschain/client/cli/cli_last_block_height.go b/x/crosschain/client/cli/cli_last_block_height.go index b3e693dc31..3f1dfb54a9 100644 --- a/x/crosschain/client/cli/cli_last_block_height.go +++ b/x/crosschain/client/cli/cli_last_block_height.go @@ -13,7 +13,7 @@ func CmdListLastBlockHeight() *cobra.Command { cmd := &cobra.Command{ Use: "list-last-block-height", Short: "list all lastBlockHeight", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/crosschain/client/cli/cli_out_tx_tracker.go b/x/crosschain/client/cli/cli_out_tx_tracker.go index 109a07d52a..143f237169 100644 --- a/x/crosschain/client/cli/cli_out_tx_tracker.go +++ b/x/crosschain/client/cli/cli_out_tx_tracker.go @@ -15,7 +15,7 @@ func CmdListOutTxTracker() *cobra.Command { cmd := &cobra.Command{ Use: "list-out-tx-tracker", Short: "list all OutTxTracker", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/crosschain/client/cli/cli_zeta_height.go b/x/crosschain/client/cli/cli_zeta_height.go index 8f855cd46e..4287d561c0 100644 --- a/x/crosschain/client/cli/cli_zeta_height.go +++ b/x/crosschain/client/cli/cli_zeta_height.go @@ -12,7 +12,7 @@ func CmdLastZetaHeight() *cobra.Command { Use: "last-zeta-height", Short: "Query last Zeta Height", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/crosschain/client/cli/query_in_tx_hash_to_cctx.go b/x/crosschain/client/cli/query_in_tx_hash_to_cctx.go index e34d52886b..4e9444d6b6 100644 --- a/x/crosschain/client/cli/query_in_tx_hash_to_cctx.go +++ b/x/crosschain/client/cli/query_in_tx_hash_to_cctx.go @@ -13,7 +13,7 @@ func CmdListInTxHashToCctx() *cobra.Command { cmd := &cobra.Command{ Use: "list-in-tx-hash-to-cctx", Short: "list all inTxHashToCctx", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/crosschain/client/cli/query_zeta_accounting.go b/x/crosschain/client/cli/query_zeta_accounting.go index aece6e6f37..29f35cdc4b 100644 --- a/x/crosschain/client/cli/query_zeta_accounting.go +++ b/x/crosschain/client/cli/query_zeta_accounting.go @@ -12,7 +12,7 @@ func CmdGetZetaAccounting() *cobra.Command { Use: "get-zeta-accounting", Short: "Query zeta accounting", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err diff --git a/x/crosschain/keeper/grpc_query_cctx.go b/x/crosschain/keeper/grpc_query_cctx.go index 74bdc49293..d221bc0991 100644 --- a/x/crosschain/keeper/grpc_query_cctx.go +++ b/x/crosschain/keeper/grpc_query_cctx.go @@ -38,7 +38,7 @@ func (k Keeper) CctxAll(c context.Context, req *types.QueryAllCctxRequest) (*typ store := ctx.KVStore(k.storeKey) sendStore := prefix.NewStore(store, types.KeyPrefix(types.SendKey)) - pageRes, err := query.Paginate(sendStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(sendStore, req.Pagination, func(_ []byte, value []byte) error { var send types.CrossChainTx if err := k.cdc.Unmarshal(value, &send); err != nil { return err diff --git a/x/crosschain/keeper/grpc_query_gas_price.go b/x/crosschain/keeper/grpc_query_gas_price.go index b703ff44a2..311bdc1d6b 100644 --- a/x/crosschain/keeper/grpc_query_gas_price.go +++ b/x/crosschain/keeper/grpc_query_gas_price.go @@ -23,7 +23,7 @@ func (k Keeper) GasPriceAll(c context.Context, req *types.QueryAllGasPriceReques store := ctx.KVStore(k.storeKey) gasPriceStore := prefix.NewStore(store, types.KeyPrefix(types.GasPriceKey)) - pageRes, err := query.Paginate(gasPriceStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(gasPriceStore, req.Pagination, func(_ []byte, value []byte) error { var gasPrice types.GasPrice if err := k.cdc.Unmarshal(value, &gasPrice); err != nil { return err diff --git a/x/crosschain/keeper/grpc_query_in_tx_hash_to_cctx.go b/x/crosschain/keeper/grpc_query_in_tx_hash_to_cctx.go index 2d3fe05be9..a30c33edf8 100644 --- a/x/crosschain/keeper/grpc_query_in_tx_hash_to_cctx.go +++ b/x/crosschain/keeper/grpc_query_in_tx_hash_to_cctx.go @@ -22,7 +22,7 @@ func (k Keeper) InTxHashToCctxAll(c context.Context, req *types.QueryAllInTxHash store := ctx.KVStore(k.storeKey) inTxHashToCctxStore := prefix.NewStore(store, types.KeyPrefix(types.InTxHashToCctxKeyPrefix)) - pageRes, err := query.Paginate(inTxHashToCctxStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(inTxHashToCctxStore, req.Pagination, func(_ []byte, value []byte) error { var inTxHashToCctx types.InTxHashToCctx if err := k.cdc.Unmarshal(value, &inTxHashToCctx); err != nil { return err diff --git a/x/crosschain/keeper/grpc_query_last_block_height.go b/x/crosschain/keeper/grpc_query_last_block_height.go index 633c440dc9..875a5facf2 100644 --- a/x/crosschain/keeper/grpc_query_last_block_height.go +++ b/x/crosschain/keeper/grpc_query_last_block_height.go @@ -23,7 +23,7 @@ func (k Keeper) LastBlockHeightAll(c context.Context, req *types.QueryAllLastBlo store := ctx.KVStore(k.storeKey) lastBlockHeightStore := prefix.NewStore(store, types.KeyPrefix(types.LastBlockHeightKey)) - pageRes, err := query.Paginate(lastBlockHeightStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(lastBlockHeightStore, req.Pagination, func(_ []byte, value []byte) error { var lastBlockHeight types.LastBlockHeight if err := k.cdc.Unmarshal(value, &lastBlockHeight); err != nil { return err diff --git a/x/crosschain/keeper/grpc_query_out_tx_tracker.go b/x/crosschain/keeper/grpc_query_out_tx_tracker.go index 0eac4d35b1..0170953eb2 100644 --- a/x/crosschain/keeper/grpc_query_out_tx_tracker.go +++ b/x/crosschain/keeper/grpc_query_out_tx_tracker.go @@ -22,7 +22,7 @@ func (k Keeper) OutTxTrackerAll(c context.Context, req *types.QueryAllOutTxTrack store := ctx.KVStore(k.storeKey) outTxTrackerStore := prefix.NewStore(store, types.KeyPrefix(types.OutTxTrackerKeyPrefix)) - pageRes, err := query.Paginate(outTxTrackerStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(outTxTrackerStore, req.Pagination, func(_ []byte, value []byte) error { var outTxTracker types.OutTxTracker if err := k.cdc.Unmarshal(value, &outTxTracker); err != nil { return err @@ -49,7 +49,7 @@ func (k Keeper) OutTxTrackerAllByChain(c context.Context, req *types.QueryAllOut store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.OutTxTrackerKeyPrefix)) chainStore := prefix.NewStore(store, types.KeyPrefix(fmt.Sprintf("%d-", req.Chain))) - pageRes, err := query.Paginate(chainStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(chainStore, req.Pagination, func(_ []byte, value []byte) error { var outTxTracker types.OutTxTracker if err := k.cdc.Unmarshal(value, &outTxTracker); err != nil { return err diff --git a/x/crosschain/keeper/in_tx_tracker.go b/x/crosschain/keeper/in_tx_tracker.go index d53c56c57f..2d7849ee49 100644 --- a/x/crosschain/keeper/in_tx_tracker.go +++ b/x/crosschain/keeper/in_tx_tracker.go @@ -44,7 +44,7 @@ func (k Keeper) GetAllInTxTrackerPaginated(ctx sdk.Context, pagination *query.Pa store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InTxTrackerKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() - pageRes, err = query.Paginate(store, pagination, func(key []byte, value []byte) error { + pageRes, err = query.Paginate(store, pagination, func(_ []byte, value []byte) error { var inTxTracker types.InTxTracker if err := k.cdc.Unmarshal(value, &inTxTracker); err != nil { return err @@ -82,7 +82,7 @@ func (k Keeper) GetAllInTxTrackerForChain(ctx sdk.Context, chainID int64) (list func (k Keeper) GetAllInTxTrackerForChainPaginated(ctx sdk.Context, chainID int64, pagination *query.PageRequest) (inTxTrackers []types.InTxTracker, pageRes *query.PageResponse, err error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(fmt.Sprintf("%s", types.InTxTrackerKeyPrefix))) chainStore := prefix.NewStore(store, types.KeyPrefix(fmt.Sprintf("%d-", chainID))) - pageRes, err = query.Paginate(chainStore, pagination, func(key []byte, value []byte) error { + pageRes, err = query.Paginate(chainStore, pagination, func(_ []byte, value []byte) error { var inTxTracker types.InTxTracker if err := k.cdc.Unmarshal(value, &inTxTracker); err != nil { return err diff --git a/x/emissions/client/cli/query_get_emmisons_factors.go b/x/emissions/client/cli/query_get_emmisons_factors.go index 0749d33218..304f7760dc 100644 --- a/x/emissions/client/cli/query_get_emmisons_factors.go +++ b/x/emissions/client/cli/query_get_emmisons_factors.go @@ -12,7 +12,7 @@ func CmdGetEmmisonsFactors() *cobra.Command { Use: "get-emmisons-factors", Short: "Query GetEmmisonsFactors", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/emissions/client/cli/query_list_balances.go b/x/emissions/client/cli/query_list_balances.go index c20ca85500..83e4609fa2 100644 --- a/x/emissions/client/cli/query_list_balances.go +++ b/x/emissions/client/cli/query_list_balances.go @@ -12,7 +12,7 @@ func CmdListPoolAddresses() *cobra.Command { Use: "list-pool-addresses", Short: "Query list-pool-addresses", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/emissions/client/cli/query_params.go b/x/emissions/client/cli/query_params.go index 55b2067c40..82d3ef153a 100644 --- a/x/emissions/client/cli/query_params.go +++ b/x/emissions/client/cli/query_params.go @@ -14,7 +14,7 @@ func CmdQueryParams() *cobra.Command { Use: "params", Short: "shows the parameters of the module", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/fungible/client/cli/query_foreign_coins.go b/x/fungible/client/cli/query_foreign_coins.go index 7410077321..e115fbd65b 100644 --- a/x/fungible/client/cli/query_foreign_coins.go +++ b/x/fungible/client/cli/query_foreign_coins.go @@ -13,7 +13,7 @@ func CmdListForeignCoins() *cobra.Command { cmd := &cobra.Command{ Use: "list-foreign-coins", Short: "list all ForeignCoins", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/fungible/client/cli/query_gas_stability_pool.go b/x/fungible/client/cli/query_gas_stability_pool.go index 46e2fa3ae8..516353daae 100644 --- a/x/fungible/client/cli/query_gas_stability_pool.go +++ b/x/fungible/client/cli/query_gas_stability_pool.go @@ -15,7 +15,7 @@ func CmdGasStabilityPoolAddress() *cobra.Command { Use: "gas-stability-pool-address", Short: "query the address of a gas stability pool", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) @@ -74,7 +74,7 @@ func CmdGasStabilityPoolBalances() *cobra.Command { Use: "gas-stability-pool-balances", Short: "query all gas stability pool balances", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/fungible/client/cli/query_params.go b/x/fungible/client/cli/query_params.go index fad97be7dd..273bee2079 100644 --- a/x/fungible/client/cli/query_params.go +++ b/x/fungible/client/cli/query_params.go @@ -14,7 +14,7 @@ func CmdQueryParams() *cobra.Command { Use: "params", Short: "shows the parameters of the module", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/fungible/client/cli/query_system_contract.go b/x/fungible/client/cli/query_system_contract.go index df79e833d9..f4fe29cc59 100644 --- a/x/fungible/client/cli/query_system_contract.go +++ b/x/fungible/client/cli/query_system_contract.go @@ -13,7 +13,7 @@ func CmdSystemContract() *cobra.Command { cmd := &cobra.Command{ Use: "system-contract", Short: "query system contract", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/fungible/client/cli/tx_deploy_system_contracts.go b/x/fungible/client/cli/tx_deploy_system_contracts.go index b8ed9dd9d2..c57e68f65e 100644 --- a/x/fungible/client/cli/tx_deploy_system_contracts.go +++ b/x/fungible/client/cli/tx_deploy_system_contracts.go @@ -13,7 +13,7 @@ func CmdDeploySystemContracts() *cobra.Command { Use: "deploy-system-contracts", Short: "Broadcast message SystemContracts", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err diff --git a/x/fungible/keeper/grpc_query_foreign_coins.go b/x/fungible/keeper/grpc_query_foreign_coins.go index 2688dc6d6b..20c661d7d1 100644 --- a/x/fungible/keeper/grpc_query_foreign_coins.go +++ b/x/fungible/keeper/grpc_query_foreign_coins.go @@ -22,7 +22,7 @@ func (k Keeper) ForeignCoinsAll(c context.Context, req *types.QueryAllForeignCoi store := ctx.KVStore(k.storeKey) foreignCoinsStore := prefix.NewStore(store, types.KeyPrefix(types.ForeignCoinsKeyPrefix)) - pageRes, err := query.Paginate(foreignCoinsStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(foreignCoinsStore, req.Pagination, func(_ []byte, value []byte) error { var foreignCoins types.ForeignCoins if err := k.cdc.Unmarshal(value, &foreignCoins); err != nil { return err diff --git a/x/observer/client/cli/query_blame.go b/x/observer/client/cli/query_blame.go index 462c442279..efe7945a73 100644 --- a/x/observer/client/cli/query_blame.go +++ b/x/observer/client/cli/query_blame.go @@ -47,7 +47,7 @@ func CmdGetAllBlameRecords() *cobra.Command { Use: "list-blame", Short: "Query AllBlameRecords", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/observer/client/cli/query_chain_nonce.go b/x/observer/client/cli/query_chain_nonce.go index 8a0a443fca..a5a1ec1cb6 100644 --- a/x/observer/client/cli/query_chain_nonce.go +++ b/x/observer/client/cli/query_chain_nonce.go @@ -13,7 +13,7 @@ func CmdListChainNonces() *cobra.Command { cmd := &cobra.Command{ Use: "list-chain-nonces", Short: "list all chainNonces", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/observer/client/cli/query_chain_params.go b/x/observer/client/cli/query_chain_params.go index 6733c7d5c7..68433ef75e 100644 --- a/x/observer/client/cli/query_chain_params.go +++ b/x/observer/client/cli/query_chain_params.go @@ -46,7 +46,7 @@ func CmdGetChainParams() *cobra.Command { Use: "list-chain-params", Short: "Query GetChainParams", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/observer/client/cli/query_keygen.go b/x/observer/client/cli/query_keygen.go index d48fefc34d..85ec112bbe 100644 --- a/x/observer/client/cli/query_keygen.go +++ b/x/observer/client/cli/query_keygen.go @@ -14,7 +14,7 @@ func CmdShowKeygen() *cobra.Command { Use: "show-keygen", Short: "shows keygen", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/observer/client/cli/query_node_account.go b/x/observer/client/cli/query_node_account.go index 199cf87e70..51113aaac4 100644 --- a/x/observer/client/cli/query_node_account.go +++ b/x/observer/client/cli/query_node_account.go @@ -13,7 +13,7 @@ func CmdListNodeAccount() *cobra.Command { cmd := &cobra.Command{ Use: "list-node-account", Short: "list all NodeAccount", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/observer/client/cli/query_observers.go b/x/observer/client/cli/query_observers.go index e2c25d2fb0..688b32c6da 100644 --- a/x/observer/client/cli/query_observers.go +++ b/x/observer/client/cli/query_observers.go @@ -12,7 +12,7 @@ func CmdObserverSet() *cobra.Command { Use: "list-observer-set", Short: "Query observer set", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/observer/client/cli/query_params.go b/x/observer/client/cli/query_params.go index cb2af7efdf..78508a9443 100644 --- a/x/observer/client/cli/query_params.go +++ b/x/observer/client/cli/query_params.go @@ -14,7 +14,7 @@ func CmdQueryParams() *cobra.Command { Use: "params", Short: "shows the parameters of the module", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/observer/client/cli/query_pending_nonces.go b/x/observer/client/cli/query_pending_nonces.go index 0afff149fd..e15abbb893 100644 --- a/x/observer/client/cli/query_pending_nonces.go +++ b/x/observer/client/cli/query_pending_nonces.go @@ -14,7 +14,7 @@ func CmdListPendingNonces() *cobra.Command { Use: "list-pending-nonces", Short: "shows a chainNonces", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/observer/client/cli/query_permission_flags.go b/x/observer/client/cli/query_permission_flags.go index 917b47897c..fbd3f3adb5 100644 --- a/x/observer/client/cli/query_permission_flags.go +++ b/x/observer/client/cli/query_permission_flags.go @@ -14,7 +14,7 @@ func CmdShowCrosschainFlags() *cobra.Command { Use: "show-crosschain-flags", Short: "shows the crosschain flags", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/observer/client/cli/query_show_observer_count.go b/x/observer/client/cli/query_show_observer_count.go index 84ad22dde1..47240e7a74 100644 --- a/x/observer/client/cli/query_show_observer_count.go +++ b/x/observer/client/cli/query_show_observer_count.go @@ -12,7 +12,7 @@ func CmdShowObserverCount() *cobra.Command { Use: "show-observer-count", Short: "Query show-observer-count", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { diff --git a/x/observer/client/cli/query_supported_chains.go b/x/observer/client/cli/query_supported_chains.go index b4c0181d8c..913a2869ec 100644 --- a/x/observer/client/cli/query_supported_chains.go +++ b/x/observer/client/cli/query_supported_chains.go @@ -13,7 +13,7 @@ func CmdGetSupportedChains() *cobra.Command { cmd := &cobra.Command{ Use: "list-chains", Short: "list all SupportedChains", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/observer/client/cli/query_tss.go b/x/observer/client/cli/query_tss.go index 865303d423..aa917125c0 100644 --- a/x/observer/client/cli/query_tss.go +++ b/x/observer/client/cli/query_tss.go @@ -14,7 +14,7 @@ func CmdShowTSS() *cobra.Command { Use: "show-tss", Short: "shows a TSS", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) @@ -40,7 +40,7 @@ func CmdListTssHistory() *cobra.Command { Use: "list-tss-history", Short: "show historical list of TSS", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/observer/client/cli/tx_add_blame_vote.go b/x/observer/client/cli/tx_add_blame_vote.go index 95d3b0d5da..ea2272332a 100644 --- a/x/observer/client/cli/tx_add_blame_vote.go +++ b/x/observer/client/cli/tx_add_blame_vote.go @@ -71,7 +71,7 @@ func CmdEncode() *cobra.Command { Use: "encode [file.json]", Short: "Encode a json string into hex", Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(_ *cobra.Command, args []string) (err error) { fp := args[0] file, err := filepath.Abs(fp) if err != nil { diff --git a/x/observer/keeper/blame.go b/x/observer/keeper/blame.go index adbbfb0436..63e4c84809 100644 --- a/x/observer/keeper/blame.go +++ b/x/observer/keeper/blame.go @@ -37,7 +37,7 @@ func (k Keeper) GetAllBlame(ctx sdk.Context) (BlameRecords []types.Blame) { func (k Keeper) GetAllBlamePaginated(ctx sdk.Context, pagination *query.PageRequest) (blameRecords []types.Blame, pageRes *query.PageResponse, err error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BlameKey)) - pageRes, err = query.Paginate(store, pagination, func(key []byte, value []byte) error { + pageRes, err = query.Paginate(store, pagination, func(_ []byte, value []byte) error { var blame types.Blame if err := k.cdc.Unmarshal(value, &blame); err != nil { return err diff --git a/x/observer/keeper/grpc_query_block_header.go b/x/observer/keeper/grpc_query_block_header.go index 18e9c955c6..5fb29d3de2 100644 --- a/x/observer/keeper/grpc_query_block_header.go +++ b/x/observer/keeper/grpc_query_block_header.go @@ -23,7 +23,7 @@ func (k Keeper) GetAllBlockHeaders(c context.Context, req *types.QueryAllBlockHe blockHeaderStore := prefix.NewStore(store, types.KeyPrefix(types.BlockHeaderKey)) var blockHeaders []*proofs.BlockHeader - pageRes, err := query.Paginate(blockHeaderStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(blockHeaderStore, req.Pagination, func(_ []byte, value []byte) error { var blockHeader proofs.BlockHeader if err := k.cdc.Unmarshal(value, &blockHeader); err != nil { return err diff --git a/x/observer/keeper/grpc_query_node_account.go b/x/observer/keeper/grpc_query_node_account.go index 2528754448..44aa499757 100644 --- a/x/observer/keeper/grpc_query_node_account.go +++ b/x/observer/keeper/grpc_query_node_account.go @@ -22,7 +22,7 @@ func (k Keeper) NodeAccountAll(c context.Context, req *types.QueryAllNodeAccount store := ctx.KVStore(k.storeKey) nodeAccountStore := prefix.NewStore(store, types.KeyPrefix(types.NodeAccountKey)) - pageRes, err := query.Paginate(nodeAccountStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(nodeAccountStore, req.Pagination, func(_ []byte, value []byte) error { var nodeAccount types.NodeAccount if err := k.cdc.Unmarshal(value, &nodeAccount); err != nil { return err diff --git a/x/observer/keeper/grpc_query_nonces.go b/x/observer/keeper/grpc_query_nonces.go index 7c0b6d481a..80ff3a23b2 100644 --- a/x/observer/keeper/grpc_query_nonces.go +++ b/x/observer/keeper/grpc_query_nonces.go @@ -25,7 +25,7 @@ func (k Keeper) ChainNoncesAll(c context.Context, req *types.QueryAllChainNonces store := ctx.KVStore(k.storeKey) chainNoncesStore := prefix.NewStore(store, types.KeyPrefix(types.ChainNoncesKey)) - pageRes, err := query.Paginate(chainNoncesStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(chainNoncesStore, req.Pagination, func(_ []byte, value []byte) error { var chainNonces types.ChainNonces if err := k.cdc.Unmarshal(value, &chainNonces); err != nil { return err diff --git a/x/observer/keeper/pending_nonces.go b/x/observer/keeper/pending_nonces.go index 198a1219b5..34f241a10e 100644 --- a/x/observer/keeper/pending_nonces.go +++ b/x/observer/keeper/pending_nonces.go @@ -35,7 +35,7 @@ func (k Keeper) GetAllPendingNoncesPaginated(ctx sdk.Context, pagination *query. iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() - pageRes, err = query.Paginate(store, pagination, func(key []byte, value []byte) error { + pageRes, err = query.Paginate(store, pagination, func(_ []byte, value []byte) error { var val types.PendingNonces if err := k.cdc.Unmarshal(value, &val); err != nil { return err diff --git a/x/observer/keeper/tss.go b/x/observer/keeper/tss.go index 0b389d2643..43eaed47c5 100644 --- a/x/observer/keeper/tss.go +++ b/x/observer/keeper/tss.go @@ -81,7 +81,7 @@ func (k Keeper) GetAllTSS(ctx sdk.Context) (list []types.TSS) { func (k Keeper) GetAllTSSPaginated(ctx sdk.Context, pagination *query.PageRequest) (list []types.TSS, pageRes *query.PageResponse, err error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TSSHistoryKey)) - pageRes, err = query.Paginate(store, pagination, func(key []byte, value []byte) error { + pageRes, err = query.Paginate(store, pagination, func(_ []byte, value []byte) error { var tss types.TSS if err := k.cdc.Unmarshal(value, &tss); err != nil { return err