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

Revert not to use grpc/credentials/insecure for compatibility #407

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
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
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