From e3eade619dff25d45d2bfe0585936206d3c63c5b Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 23 Jun 2021 12:28:19 +0300 Subject: [PATCH] [#607] network: Remove no longer used `Address.AddTLS` method Signed-off-by: Leonard Lyubich --- pkg/network/tls.go | 11 ----------- pkg/network/tls_test.go | 27 --------------------------- 2 files changed, 38 deletions(-) diff --git a/pkg/network/tls.go b/pkg/network/tls.go index a552480eb..821f482b3 100644 --- a/pkg/network/tls.go +++ b/pkg/network/tls.go @@ -54,14 +54,3 @@ func (a Address) TLSEnabled() bool { return false } - -// AddTLS encapsulates a Address if there is no TLS yet. -func (a *Address) AddTLS() { - // not need to add TLS if it is - // already included - if a.TLSEnabled() { - return - } - - a.ma = a.ma.Encapsulate(tls) -} diff --git a/pkg/network/tls_test.go b/pkg/network/tls_test.go index cdcf1e769..541369c7f 100644 --- a/pkg/network/tls_test.go +++ b/pkg/network/tls_test.go @@ -24,30 +24,3 @@ func TestAddress_TLSEnabled(t *testing.T) { require.Equal(t, test.wantTLS, addr.TLSEnabled(), test.input) } } - -func TestAddress_AddTLS(t *testing.T) { - input, tls := "/dns4/localhost/tcp/8080", tls.String() - - testCases := [...]struct { - input string - want string - }{ - {input, input + tls}, - {input + tls, input + tls}, - } - - for _, test := range testCases { - addr := Address{ - ma: buildMultiaddr(test.input, t), - } - - addr.AddTLS() - - var netAddr Address - - err := netAddr.FromString(test.want) - require.NoError(t, err) - - require.True(t, netAddr.equal(addr), test.input) - } -}