Skip to content

Commit

Permalink
chore: linting fixes (cosmos#19978)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Apr 8, 2024
1 parent e5b0e0e commit b2835eb
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 38 deletions.
2 changes: 1 addition & 1 deletion client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont
})))
}

grpcClient, err := grpc.Dial(grpcURI, dialOpts...)
grpcClient, err := grpc.NewClient(grpcURI, dialOpts...)
if err != nil {
return Context{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func getGRPCClient(grpcConfig GRPCConfig) (*grpc.ClientConn, error) {
}

dialOptions := []grpc.DialOption{transport}
grpcClient, err := grpc.Dial(grpcConfig.Address, dialOptions...)
grpcClient, err := grpc.NewClient(grpcConfig.Address, dialOptions...)
if err != nil {
return nil, fmt.Errorf("failed to dial gRPC server at %s: %w", grpcConfig.Address, err)
}
Expand Down
2 changes: 1 addition & 1 deletion client/v2/autocli/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func initFixture(t *testing.T) *fixture {
}
}()

clientConn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
clientConn, err := grpc.NewClient(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
assert.NilError(t, err)

encodingConfig := moduletestutil.MakeTestEncodingConfig(testutil.CodecOptions{}, bank.AppModule{})
Expand Down
2 changes: 1 addition & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func startGrpcServer(
}

// if gRPC is enabled, configure gRPC client for gRPC gateway
grpcClient, err := grpc.Dial(
grpcClient, err := grpc.NewClient(
config.Address,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(
Expand Down
26 changes: 0 additions & 26 deletions store/db/rocksdb_noflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,3 @@ func (itr *rocksDBIterator) Close() error {
func (itr *rocksDBIterator) assertIsValid() {
panic("rocksdb must be built with -tags rocksdb")
}

type rocksDBBatch struct{}

func (b *rocksDBBatch) Set(key, value []byte) error {
panic("rocksdb must be built with -tags rocksdb")
}

func (b *rocksDBBatch) Delete(key []byte) error {
panic("rocksdb must be built with -tags rocksdb")
}

func (b *rocksDBBatch) Write() error {
panic("rocksdb must be built with -tags rocksdb")
}

func (b *rocksDBBatch) WriteSync() error {
panic("rocksdb must be built with -tags rocksdb")
}

func (b *rocksDBBatch) Close() error {
panic("rocksdb must be built with -tags rocksdb")
}

func (b *rocksDBBatch) GetByteSize() (int, error) {
panic("rocksdb must be built with -tags rocksdb")
}
2 changes: 1 addition & 1 deletion store/root/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (s *MigrateStoreTestSuite) TestMigrateState() {
s.Require().NoError(err)

// start the migration process
s.rootStore.StartMigration()
s.Require().NoError(s.rootStore.StartMigration())

// continue to apply changeset against the original store
latestVersion := originalLatestVersion + 1
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/server/grpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.Require().NoError(err)

val0 := s.network.GetValidators()[0]
s.conn, err = grpc.Dial(
s.conn, err = grpc.NewClient(
val0.GetAppConfig().GRPC.Address,
grpc.WithInsecure(), //nolint:staticcheck // ignore SA1019, we don't need to use a secure connection for tests
grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(s.cfg.InterfaceRegistry).GRPCCodec())),
Expand Down
2 changes: 1 addition & 1 deletion tests/starship/tests/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *TestSuite) SetupTest() {

s.cdc = encodingConfig

grpcConn, err := grpc.Dial(
grpcConn, err := grpc.NewClient(
fmt.Sprintf("127.0.0.1:%d", config.GetChain(chainID).Ports.Grpc),
grpc.WithInsecure(), //nolint:staticcheck // ignore SA1019, we don't need to use a secure connection for tests
grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(s.cdc.InterfaceRegistry).GRPCCodec())))
Expand Down
2 changes: 1 addition & 1 deletion tools/hubl/internal/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (c *ChainInfo) OpenClient() (*grpc.ClientConn, error) {
}

var err error
c.client, err = grpc.Dial(endpoint.Endpoint, grpc.WithTransportCredentials(creds))
c.client, err = grpc.NewClient(endpoint.Endpoint, grpc.WithTransportCredentials(creds))
if err != nil {
res = errors.Join(res, err)
continue
Expand Down
5 changes: 3 additions & 2 deletions x/accounts/defaults/lockup/lockup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
"time"

"github.com/cosmos/gogoproto/proto"

"cosmossdk.io/collections"
collcodec "cosmossdk.io/collections/codec"
"cosmossdk.io/core/address"
Expand All @@ -15,9 +17,8 @@ import (
"cosmossdk.io/x/accounts/accountstd"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
banktypes "cosmossdk.io/x/bank/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/gogoproto/proto"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
Expand Down
6 changes: 4 additions & 2 deletions x/accounts/defaults/lockup/protov2_wrapper.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package lockup

import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/runtime/protoiface"

bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
stakingv1beta1 "cosmossdk.io/api/cosmos/staking/v1beta1"

sdk "github.com/cosmos/cosmos-sdk/types"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/runtime/protoiface"
)

type ProtoMsg = protoiface.MessageV1
Expand Down

0 comments on commit b2835eb

Please sign in to comment.