diff --git a/client/broadcast.go b/client/broadcast.go index cfc2e9a768..5598cbceba 100644 --- a/client/broadcast.go +++ b/client/broadcast.go @@ -117,7 +117,7 @@ func (ctx Context) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error) { // TxServiceBroadcast is a helper function to broadcast a Tx with the correct gRPC types // from the tx service. Calls `clientCtx.BroadcastTx` under the hood. -func TxServiceBroadcast(grpcCtx context.Context, clientCtx Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) { +func TxServiceBroadcast(_ context.Context, clientCtx Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error) { if req == nil || req.TxBytes == nil { return nil, status.Error(codes.InvalidArgument, "invalid empty tx") } diff --git a/client/broadcast_test.go b/client/broadcast_test.go index 83970e5485..fcd7d1d604 100644 --- a/client/broadcast_test.go +++ b/client/broadcast_test.go @@ -21,11 +21,11 @@ type MockClient struct { err error } -func (c MockClient) BroadcastTxAsync(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { +func (c MockClient) BroadcastTxAsync(_ context.Context, _ cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { return nil, c.err } -func (c MockClient) BroadcastTxSync(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { +func (c MockClient) BroadcastTxSync(_ context.Context, _ cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) { return nil, c.err } diff --git a/client/context_test.go b/client/context_test.go index 9d701545ca..9ea673b64f 100644 --- a/client/context_test.go +++ b/client/context_test.go @@ -32,10 +32,10 @@ func TestContext_PrintProto(t *testing.T) { Size_: "big", Name: "Spot", } - any, err := types.NewAnyWithValue(animal) + anyAnimal, err := types.NewAnyWithValue(animal) require.NoError(t, err) hasAnimal := &testdata.HasAnimal{ - Animal: any, + Animal: anyAnimal, X: 10, } @@ -75,10 +75,10 @@ func TestContext_PrintObjectLegacy(t *testing.T) { Size_: "big", Name: "Spot", } - any, err := types.NewAnyWithValue(animal) + anyAnimal, err := types.NewAnyWithValue(animal) require.NoError(t, err) hasAnimal := &testdata.HasAnimal{ - Animal: any, + Animal: anyAnimal, X: 10, } diff --git a/client/grpc/cmtservice/service.go b/client/grpc/cmtservice/service.go index 82b23d75eb..9bf9bb4fb7 100644 --- a/client/grpc/cmtservice/service.go +++ b/client/grpc/cmtservice/service.go @@ -183,7 +183,7 @@ func validatorsOutput(ctx context.Context, cctx client.Context, height *int64, p } // GetNodeInfo implements ServiceServer.GetNodeInfo -func (s queryServer) GetNodeInfo(ctx context.Context, req *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { +func (s queryServer) GetNodeInfo(ctx context.Context, _ *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { status, err := getNodeStatus(ctx, s.clientCtx) if err != nil { return nil, err @@ -218,7 +218,7 @@ func (s queryServer) GetNodeInfo(ctx context.Context, req *GetNodeInfoRequest) ( return &resp, nil } -func (s queryServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABCIQueryResponse, error) { +func (s queryServer) ABCIQuery(_ context.Context, req *ABCIQueryRequest) (*ABCIQueryResponse, error) { if s.queryFn == nil { return nil, status.Error(codes.Internal, "ABCI Query handler undefined") } diff --git a/client/keys/add.go b/client/keys/add.go index 373b4b9aec..4392f90bf2 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -229,8 +229,8 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf // Get bip39 mnemonic var mnemonic, bip39Passphrase string - recover, _ := cmd.Flags().GetBool(flagRecover) - if recover { + recoverFlag, _ := cmd.Flags().GetBool(flagRecover) + if recoverFlag { mnemonic, err = input.GetString("Enter your bip39 mnemonic", inBuf) if err != nil { return err @@ -291,7 +291,7 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf } // Recover key from seed passphrase - if recover { + if recoverFlag { // Hide mnemonic from output showMnemonic = false mnemonic = "" diff --git a/client/tx/aux_builder.go b/client/tx/aux_builder.go index 331f4a8459..0ad68502f2 100644 --- a/client/tx/aux_builder.go +++ b/client/tx/aux_builder.go @@ -95,14 +95,14 @@ func (b *AuxTxBuilder) SetSequence(accSeq uint64) { // SetPubKey sets the aux signer's pubkey in the AuxSignerData. func (b *AuxTxBuilder) SetPubKey(pk cryptotypes.PubKey) error { - any, err := codectypes.NewAnyWithValue(pk) + anyAnimal, err := codectypes.NewAnyWithValue(pk) if err != nil { return err } b.checkEmptyFields() - b.auxSignerData.SignDoc.PublicKey = any + b.auxSignerData.SignDoc.PublicKey = anyAnimal return nil } diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index 6c0d3a7eb2..202ed022c5 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -28,7 +28,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -func newTestTxConfig(t *testing.T) (client.TxConfig, codec.Codec) { +func newTestTxConfig() (client.TxConfig, codec.Codec) { encodingConfig := moduletestutil.MakeTestEncodingConfig() return authtx.NewTxConfig(codec.NewProtoCodec(encodingConfig.InterfaceRegistry), authtx.DefaultSignModes), encodingConfig.Codec } @@ -40,7 +40,7 @@ type mockContext struct { wantErr bool } -func (m mockContext) Invoke(grpcCtx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) { +func (m mockContext) Invoke(_ context.Context, _ string, _, reply interface{}, _ ...grpc.CallOption) (err error) { if m.wantErr { return fmt.Errorf("mock err") } @@ -77,7 +77,7 @@ func TestCalculateGas(t *testing.T) { for _, tc := range testCases { stc := tc - txCfg, _ := newTestTxConfig(t) + txCfg, _ := newTestTxConfig() txf := tx.Factory{}. WithChainID("test-chain"). @@ -103,7 +103,7 @@ func TestCalculateGas(t *testing.T) { } func TestBuildSimTx(t *testing.T) { - txCfg, cdc := newTestTxConfig(t) + txCfg, cdc := newTestTxConfig() kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, cdc) require.NoError(t, err) @@ -129,7 +129,7 @@ func TestBuildSimTx(t *testing.T) { } func TestBuildUnsignedTx(t *testing.T) { - txConfig, cdc := newTestTxConfig(t) + txConfig, cdc := newTestTxConfig() kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, cdc) require.NoError(t, err) @@ -158,7 +158,7 @@ func TestBuildUnsignedTx(t *testing.T) { } func TestMnemonicInMemo(t *testing.T) { - txConfig, cdc := newTestTxConfig(t) + txConfig, cdc := newTestTxConfig() kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, cdc) require.NoError(t, err) @@ -207,7 +207,7 @@ func TestMnemonicInMemo(t *testing.T) { } func TestSign(t *testing.T) { - txConfig, cdc := newTestTxConfig(t) + txConfig, cdc := newTestTxConfig() requireT := require.New(t) path := hd.CreateHDPath(118, 0, 0).String() kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, cdc) @@ -363,7 +363,7 @@ func TestSign(t *testing.T) { } func TestPreprocessHook(t *testing.T) { - txConfig, cdc := newTestTxConfig(t) + txConfig, cdc := newTestTxConfig() requireT := require.New(t) path := hd.CreateHDPath(118, 0, 0).String() kb, err := keyring.New(t.Name(), "test", t.TempDir(), nil, cdc)