Skip to content

Commit

Permalink
Revert not to use grpc/credentials/insecure for compatibility (#407)
Browse files Browse the repository at this point in the history
See:
2ee2c37
  • Loading branch information
tnasu authored Apr 27, 2022
1 parent 954ebc8 commit 2d8cb08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions abci/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"sync"
"time"

"google.golang.org/grpc/credentials/insecure"

"golang.org/x/net/context"
"google.golang.org/grpc"

Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions abci/example/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"testing"
"time"

"google.golang.org/grpc/credentials/insecure"

"github.com/stretchr/testify/require"

"google.golang.org/grpc"
Expand Down Expand Up @@ -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())
}
Expand Down
7 changes: 2 additions & 5 deletions rpc/grpc/client_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package coregrpc
import (
"net"

"google.golang.org/grpc/credentials/insecure"

"golang.org/x/net/context"
"google.golang.org/grpc"

Expand All @@ -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)
}
Expand Down

0 comments on commit 2d8cb08

Please sign in to comment.