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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Mark Rushakoff 2023-03-01 11:55:48 -05:00 committed by GitHub
parent e33c5a7e49
commit 9150a9d255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"
@ -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)
services, err := rc.ListServices()
s.Require().NoError(err)