chore: linting fixes (#19978)

This commit is contained in:
Marko 2024-04-08 20:12:10 +02:00 committed by GitHub
parent e5b0e0e4b2
commit b2835eb78b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 15 additions and 38 deletions

View File

@ -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
}

View File

@ -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)
}

View File

@ -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{})

View File

@ -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(

View File

@ -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")
}

View File

@ -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

View File

@ -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())),

View File

@ -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())))

View File

@ -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

View File

@ -6,6 +6,8 @@ import (
"fmt"
"time"
"github.com/cosmos/gogoproto/proto"
"cosmossdk.io/collections"
collcodec "cosmossdk.io/collections/codec"
"cosmossdk.io/core/address"
@ -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"
)

View File

@ -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