[#607] network: Remove no longer used Address.AddTLS
method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b723c92ef8
commit
e3eade619d
2 changed files with 0 additions and 38 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue