Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(server/grpc): avoid using deprecated protoreflect function #15221

Merged
merged 3 commits into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions server/grpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/jhump/protoreflect/grpcreflect"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"

"github.com/cosmos/cosmos-sdk/client"
reflectionv1 "github.com/cosmos/cosmos-sdk/client/grpc/reflection"
Expand Down Expand Up @@ -110,12 +109,11 @@ func (s *IntegrationTestSuite) TestGRPCServer_Reflection() {
// Test server reflection
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
stub := rpb.NewServerReflectionClient(s.conn)
// NOTE(fdymylja): we use grpcreflect because it solves imports too
// so that we can always assert that given a reflection server it is
// possible to fully query all the methods, without having any context
// on the proto registry
rc := grpcreflect.NewClient(ctx, stub)
rc := grpcreflect.NewClientAuto(ctx, s.conn)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not NewClientV1Alpha to keep the same behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation note says:

Use NewClientV1Alpha if you are intentionally pinning the v1alpha version of the reflection service.

I don't imagine we are intentionally pinning v1alpha here, are we?


services, err := rc.ListServices()
s.Require().NoError(err)
Expand Down