diff --git a/client-sdk/go/config/network.go b/client-sdk/go/config/network.go index ed96ce0499..2557902132 100644 --- a/client-sdk/go/config/network.go +++ b/client-sdk/go/config/network.go @@ -3,7 +3,6 @@ package config import ( "fmt" "net/url" - "strings" "github.com/oasisprotocol/oasis-core/go/common/crypto/hash" ) @@ -136,8 +135,3 @@ func (n *Network) Validate() error { return nil } - -// IsLocalRPC checks whether the RPC endpoint points to a local UNIX socket. -func (n *Network) IsLocalRPC() bool { - return strings.HasPrefix(n.RPC, "unix:") -} diff --git a/client-sdk/go/connection/connection.go b/client-sdk/go/connection/connection.go index afa2ebc4d0..8cb31d091b 100644 --- a/client-sdk/go/connection/connection.go +++ b/client-sdk/go/connection/connection.go @@ -105,7 +105,7 @@ func Connect(ctx context.Context, net *config.Network) (Connection, error) { // omitting the chain context check. func ConnectNoVerify(_ context.Context, net *config.Network) (Connection, error) { var dialOpts []grpc.DialOption - switch net.IsLocalRPC() { + switch cmnGrpc.IsLocalAddress(net.RPC) { case true: // No TLS needed for local nodes. dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))