diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 58721a755f..407ba89aa5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,9 +23,9 @@ jobs: **/**.go go.mod go.sum - - uses: golangci/golangci-lint-action@v3.6.0 + - uses: golangci/golangci-lint-action@v4.0.0 with: - version: v1.54.2 + version: v1.57.1 args: --timeout 10m github-token: ${{ secrets.github_token }} if: env.GIT_DIFF diff --git a/app/test/process_proposal_test.go b/app/test/process_proposal_test.go index ecbd118190..9fd035d927 100644 --- a/app/test/process_proposal_test.go +++ b/app/test/process_proposal_test.go @@ -89,7 +89,7 @@ func TestProcessProposal(t *testing.T) { { name: "valid untouched data", input: validData(), - mutator: func(d *tmproto.Data) {}, + mutator: func(_ *tmproto.Data) {}, expectedResult: abci.ResponseProcessProposal_ACCEPT, }, { diff --git a/cmd/celestia-appd/cmd/addrbook.go b/cmd/celestia-appd/cmd/addrbook.go index 296b72e152..1a67ff801f 100644 --- a/cmd/celestia-appd/cmd/addrbook.go +++ b/cmd/celestia-appd/cmd/addrbook.go @@ -19,7 +19,7 @@ func addrbookCommand() *cobra.Command { "The first argument (peers.txt) should contain a new line separated list of peers. The format for a peer is `id@ip:port` or `id@domain:port`.\n" + "The second argument (addrbook.json) should contain the complete file path, including both the directory path and the desired output file name, in the following format: `path/to/filename`. The address book is saved to the output file in JSON format.\n", Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { inputFile := args[0] outputFile := args[1] diff --git a/test/cmd/txsim/cli.go b/test/cmd/txsim/cli.go index f34d56edaa..cad30379d9 100644 --- a/test/cmd/txsim/cli.go +++ b/test/cmd/txsim/cli.go @@ -57,13 +57,13 @@ func command() *cobra.Command { Use: "txsim", Short: "Celestia Transaction Simulator", Long: ` -Txsim is a tool for randomized transaction generation on celestia networks. The tool relies on -defined sequences; recursive patterns between one or more accounts which will continually submit -transactions. You can use flags or environment variables (TXSIM_RPC, TXSIM_GRPC, TXSIM_SEED, +Txsim is a tool for randomized transaction generation on celestia networks. The tool relies on +defined sequences; recursive patterns between one or more accounts which will continually submit +transactions. You can use flags or environment variables (TXSIM_RPC, TXSIM_GRPC, TXSIM_SEED, TXSIM_POLL, TXSIM_KEYPATH) to configure the client. The keyring provided should have at least one well funded account that can act as the master account. The command runs until all sequences error.`, Example: "txsim --key-path /path/to/keyring --rpc-endpoints localhost:26657 --grpc-endpoints localhost:9090 --seed 1234 --poll-time 1s --blob 5", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { var ( keys keyring.Keyring err error diff --git a/test/e2e/cmd/e2e/main.go b/test/e2e/cmd/e2e/main.go index 551ce64fa6..2acd87f4c0 100644 --- a/test/e2e/cmd/e2e/main.go +++ b/test/e2e/cmd/e2e/main.go @@ -27,7 +27,7 @@ func NewCLI() *CLI { Use: "e2e", Short: "Command line runner for celestia app e2e framework", SilenceUsage: true, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { file, err := cmd.Flags().GetString("file") if err != nil { return err @@ -46,7 +46,7 @@ func NewCLI() *CLI { cli.testnet = testnet return nil }, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { ctx := cmd.Context() if err := e2e.Cleanup(ctx, cli.testnet); err != nil { return fmt.Errorf("preparing testnet: %w", err) @@ -79,7 +79,7 @@ func NewCLI() *CLI { cli.root.AddCommand(&cobra.Command{ Use: "setup", Short: "Setups a testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return e2e.Setup(cmd.Context(), cli.testnet) }, }) @@ -87,7 +87,7 @@ func NewCLI() *CLI { cli.root.AddCommand(&cobra.Command{ Use: "start", Short: "Starts a testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return e2e.Start(cmd.Context(), cli.testnet) }, }) @@ -95,7 +95,7 @@ func NewCLI() *CLI { cli.root.AddCommand(&cobra.Command{ Use: "stop", Short: "Stops a testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return e2e.Stop(cmd.Context(), cli.testnet) }, }) @@ -103,7 +103,7 @@ func NewCLI() *CLI { cli.root.AddCommand(&cobra.Command{ Use: "cleanup", Short: "Tears down network and removes all resources", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return e2e.Cleanup(cmd.Context(), cli.testnet) }, }) diff --git a/x/blob/ante/ante_test.go b/x/blob/ante/ante_test.go index 80acc877f2..1f87034ff5 100644 --- a/x/blob/ante/ante_test.go +++ b/x/blob/ante/ante_test.go @@ -94,7 +94,7 @@ func TestPFBAnteHandler(t *testing.T) { txBuilder := txConfig.NewTxBuilder() require.NoError(t, txBuilder.SetMsgs(tc.pfb)) tx := txBuilder.GetTx() - _, err := anteHandler.AnteHandle(ctx, tx, false, func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) { return ctx, nil }) + _, err := anteHandler.AnteHandle(ctx, tx, false, func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { return ctx, nil }) if tc.wantErr { require.Error(t, err) } else { diff --git a/x/blob/client/cli/payforblob.go b/x/blob/client/cli/payforblob.go index 9a9f8170df..b1a1d629b0 100644 --- a/x/blob/client/cli/payforblob.go +++ b/x/blob/client/cli/payforblob.go @@ -47,7 +47,7 @@ func CmdPayForBlob() *cobra.Command { // TODO: allow for more than one blob to be sumbmitted via the CLI "This command currently only supports a single blob per invocation.\n", Aliases: []string{"PayForBlob"}, - Args: func(cmd *cobra.Command, args []string) error { + Args: func(_ *cobra.Command, args []string) error { if len(args) < 2 { return fmt.Errorf("PayForBlobs requires two arguments: namespaceID and blob") } diff --git a/x/blob/client/cli/query_params.go b/x/blob/client/cli/query_params.go index 7c59e94e8c..0fc3b95b5b 100644 --- a/x/blob/client/cli/query_params.go +++ b/x/blob/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/blob/types/payforblob.go b/x/blob/types/payforblob.go index e441e2efa7..291aa43959 100644 --- a/x/blob/types/payforblob.go +++ b/x/blob/types/payforblob.go @@ -58,10 +58,10 @@ func NewMsgPayForBlobs(signer string, blobs ...*Blob) (*MsgPayForBlobs, error) { return nil, err } - namespaceVersions, namespaceIds, sizes, shareVersions := extractBlobComponents(blobs) + namespaceVersions, namespaceIDs, sizes, shareVersions := extractBlobComponents(blobs) namespaces := []appns.Namespace{} for i := range namespaceVersions { - namespace, err := appns.New(uint8(namespaceVersions[i]), namespaceIds[i]) + namespace, err := appns.New(uint8(namespaceVersions[i]), namespaceIDs[i]) if err != nil { return nil, err } @@ -325,20 +325,20 @@ func ValidateBlobs(blobs ...*Blob) error { // extractBlobComponents separates and returns the components of a slice of // blobs. -func extractBlobComponents(pblobs []*tmproto.Blob) (namespaceVersions []uint32, namespaceIds [][]byte, sizes []uint32, shareVersions []uint32) { +func extractBlobComponents(pblobs []*tmproto.Blob) (namespaceVersions []uint32, namespaceIDs [][]byte, sizes []uint32, shareVersions []uint32) { namespaceVersions = make([]uint32, len(pblobs)) - namespaceIds = make([][]byte, len(pblobs)) + namespaceIDs = make([][]byte, len(pblobs)) sizes = make([]uint32, len(pblobs)) shareVersions = make([]uint32, len(pblobs)) for i, pblob := range pblobs { namespaceVersions[i] = pblob.NamespaceVersion - namespaceIds[i] = pblob.NamespaceId + namespaceIDs[i] = pblob.NamespaceId sizes[i] = uint32(len(pblob.Data)) shareVersions[i] = pblob.ShareVersion } - return namespaceVersions, namespaceIds, sizes, shareVersions + return namespaceVersions, namespaceIDs, sizes, shareVersions } // merkleMountainRangeSizes returns the sizes (number of leaf nodes) of the diff --git a/x/blob/types/payforblob_test.go b/x/blob/types/payforblob_test.go index 84c79f14da..d5548a709e 100644 --- a/x/blob/types/payforblob_test.go +++ b/x/blob/types/payforblob_test.go @@ -297,10 +297,10 @@ func invalidNamespaceVersionMsgPayForBlobs(t *testing.T) *MsgPayForBlobs { commitments, err := CreateCommitments(blobs) require.NoError(t, err) - namespaceVersions, namespaceIds, sizes, shareVersions := extractBlobComponents(blobs) + namespaceVersions, namespaceIDs, sizes, shareVersions := extractBlobComponents(blobs) namespaces := []appns.Namespace{} for i := range namespaceVersions { - namespace, err := appns.New(uint8(namespaceVersions[i]), namespaceIds[i]) + namespace, err := appns.New(uint8(namespaceVersions[i]), namespaceIDs[i]) require.NoError(t, err) namespaces = append(namespaces, namespace) } diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index b92636f6c4..983d0fce63 100644 --- a/x/mint/client/cli/query.go +++ b/x/mint/client/cli/query.go @@ -36,7 +36,7 @@ func GetCmdQueryInflationRate() *cobra.Command { Use: "inflation", Short: "Query the current inflation rate", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -65,7 +65,7 @@ func GetCmdQueryAnnualProvisions() *cobra.Command { Use: "annual-provisions", Short: "Query the current annual provisions", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -93,7 +93,7 @@ func GetCmdQueryGenesisTime() *cobra.Command { Use: "genesis-time", Short: "Query the genesis time", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err diff --git a/x/qgb/client/query_test.go b/x/qgb/client/query_test.go index 65789ba989..689cfe49b7 100644 --- a/x/qgb/client/query_test.go +++ b/x/qgb/client/query_test.go @@ -44,7 +44,7 @@ func (s *CLITestSuite) TestQueryAttestationByNonce() { } for _, tc := range testCases { - s.T().Run(tc.name, func(t *testing.T) { + s.T().Run(tc.name, func(_ *testing.T) { cmd := client.CmdQueryAttestationByNonce() clientCtx := val.ClientCtx