[#607] network: Remove no longer used Address.AddTLS method

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-23 12:28:19 +03:00 committed by Leonard Lyubich
parent b723c92ef8
commit e3eade619d
2 changed files with 0 additions and 38 deletions

View file

@ -54,14 +54,3 @@ func (a Address) TLSEnabled() bool {
return false 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)
}

View file

@ -24,30 +24,3 @@ func TestAddress_TLSEnabled(t *testing.T) {
require.Equal(t, test.wantTLS, addr.TLSEnabled(), test.input) 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)
}
}