diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9c7767a2..f983b8a9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: go.sum - uses: golangci/golangci-lint-action@v4.0.0 with: - version: v1.55.2 + version: v1.57.0 args: --timeout 10m github-token: ${{ secrets.github_token }} if: env.GIT_DIFF diff --git a/README.md b/README.md index 0cb1076b..b508ed9f 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ This repo attempts to conform to [conventional commits](https://www.conventional ### Tools -1. Install [golangci-lint](https://golangci-lint.run/welcome/install) 1.55.2 +1. Install [golangci-lint](https://golangci-lint.run/welcome/install) 1.57.0 1. Install [markdownlint](https://github.com/DavidAnson/markdownlint) 1. Install [hadolint](https://github.com/hadolint/hadolint) 1. Install [yamllint](https://yamllint.readthedocs.io/en/stable/quickstart.html) diff --git a/app/module/migrations_test.go b/app/module/migrations_test.go index bae4a1b4..5ae28d3e 100644 --- a/app/module/migrations_test.go +++ b/app/module/migrations_test.go @@ -51,7 +51,7 @@ func TestModuleManagerMigration(t *testing.T) { isCalled := false cfg := module.NewConfigurator(cdc.Codec, mockServer, mockServer) - err = cfg.RegisterMigration("testModule", 1, func(ctx sdk.Context) error { + err = cfg.RegisterMigration("testModule", 1, func(_ sdk.Context) error { isCalled = true return nil }) diff --git a/app/test/process_proposal_test.go b/app/test/process_proposal_test.go index 7ec3ea6c..f218958a 100644 --- a/app/test/process_proposal_test.go +++ b/app/test/process_proposal_test.go @@ -94,7 +94,7 @@ func TestProcessProposal(t *testing.T) { { name: "valid untouched data", input: validData(), - mutator: func(d *tmproto.Data) {}, + mutator: func(_ *tmproto.Data) {}, appVersion: appconsts.LatestVersion, expectedResult: abci.ResponseProcessProposal_ACCEPT, }, diff --git a/cmd/celestia-appd/cmd/addrbook.go b/cmd/celestia-appd/cmd/addrbook.go index 296b72e1..1a67ff80 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 9444fade..b8f86819 100644 --- a/test/cmd/txsim/cli.go +++ b/test/cmd/txsim/cli.go @@ -58,13 +58,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 --grpc-endpoint 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/x/blob/ante/ante_test.go b/x/blob/ante/ante_test.go index 85c1ec28..574f4388 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/query_params.go b/x/blob/client/cli/query_params.go index 7c59e94e..0fc3b95b 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 113f080e..3d3ff65b 100644 --- a/x/blob/types/payforblob.go +++ b/x/blob/types/payforblob.go @@ -55,10 +55,10 @@ func NewMsgPayForBlobs(signer string, version uint64, blobs ...*blob.Blob) (*Msg 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 } @@ -241,18 +241,18 @@ func ValidateBlobs(blobs ...*blob.Blob) error { // ExtractBlobComponents separates and returns the components of a slice of // blobs. -func ExtractBlobComponents(pblobs []*blob.Blob) (namespaceVersions []uint32, namespaceIds [][]byte, sizes []uint32, shareVersions []uint32) { +func ExtractBlobComponents(pblobs []*blob.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 } diff --git a/x/blob/types/payforblob_test.go b/x/blob/types/payforblob_test.go index 4c104c91..2b030bf1 100644 --- a/x/blob/types/payforblob_test.go +++ b/x/blob/types/payforblob_test.go @@ -206,10 +206,10 @@ func invalidNamespaceVersionMsgPayForBlobs(t *testing.T) *types.MsgPayForBlobs { commitments, err := inclusion.CreateCommitments(blobs, merkle.HashFromByteSlices, appconsts.DefaultSubtreeRootThreshold) require.NoError(t, err) - namespaceVersions, namespaceIds, sizes, shareVersions := types.ExtractBlobComponents(blobs) + namespaceVersions, namespaceIDs, sizes, shareVersions := types.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/blobstream/client/query_test.go b/x/blobstream/client/query_test.go index 0d00d6a9..adade338 100644 --- a/x/blobstream/client/query_test.go +++ b/x/blobstream/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() _, err := clitestutil.ExecTestCLICmd(s.cctx.Context, cmd, []string{tc.nonce}) if tc.expectErr { diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index b92636f6..983d0fce 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/upgrade/cli/tx.go b/x/upgrade/cli/tx.go index fea43164..d52ba560 100644 --- a/x/upgrade/cli/tx.go +++ b/x/upgrade/cli/tx.go @@ -62,10 +62,10 @@ func CmdTryUpgrade() *cobra.Command { Use: "try-upgrade", Short: "Try to perform a software upgrade", Long: `This command will submit a TryUpgrade message to tally all -the signal votes. If a quorum has been reached, the network will upgrade +the signal votes. If a quorum has been reached, the network will upgrade to the signalled version at the following height. `, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err