diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index 2fe69217c..c8c57cae7 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -6,8 +6,6 @@ import ( "sync" "time" - "google.golang.org/grpc/credentials/insecure" - "golang.org/x/net/context" "google.golang.org/grpc" @@ -56,9 +54,8 @@ func (cli *grpcClient) OnStart() error { RETRY_LOOP: for { - conn, err := grpc.Dial(cli.addr, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithContextDialer(dialerFunc)) + //nolint:staticcheck // SA1019 Existing use of deprecated but supported dial option. + conn, err := grpc.Dial(cli.addr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) if err != nil { if cli.mustConnect { return err diff --git a/abci/example/example_test.go b/abci/example/example_test.go index a3c604f06..a7b98a30c 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "google.golang.org/grpc/credentials/insecure" - "github.com/stretchr/testify/require" "google.golang.org/grpc" @@ -150,9 +148,8 @@ func testGRPCSync(t *testing.T, app types.ABCIApplicationServer) { }) // Connect to the socket - conn, err := grpc.Dial(socket, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithContextDialer(dialerFunc)) + //nolint:staticcheck // SA1019 Existing use of deprecated but supported dial option. + conn, err := grpc.Dial(socket, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) if err != nil { t.Fatalf("Error dialing GRPC server: %v", err.Error()) } diff --git a/rpc/grpc/client_server.go b/rpc/grpc/client_server.go index 31c516bb4..48ea143f4 100644 --- a/rpc/grpc/client_server.go +++ b/rpc/grpc/client_server.go @@ -3,8 +3,6 @@ package coregrpc import ( "net" - "google.golang.org/grpc/credentials/insecure" - "golang.org/x/net/context" "google.golang.org/grpc" @@ -28,9 +26,8 @@ func StartGRPCServer(ln net.Listener) error { // StartGRPCClient dials the gRPC server using protoAddr and returns a new // BroadcastAPIClient. func StartGRPCClient(protoAddr string) BroadcastAPIClient { - conn, err := grpc.Dial(protoAddr, - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithContextDialer(dialerFunc)) + //nolint:staticcheck // SA1019 Existing use of deprecated but supported dial option. + conn, err := grpc.Dial(protoAddr, grpc.WithInsecure(), grpc.WithContextDialer(dialerFunc)) if err != nil { panic(err) }