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

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-23 12:20:45 +03:00 committed by Leonard Lyubich
parent 149367cab9
commit 61cc70d899
2 changed files with 0 additions and 26 deletions

View file

@ -7,7 +7,6 @@ import (
"github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr/net"
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
)
/*
@ -38,11 +37,6 @@ func (a Address) Equal(addr Address) bool {
return a.ma.Equal(addr.ma)
}
// WriteToNodeInfo writes Address to netmap.NodeInfo structure.
func (a Address) WriteToNodeInfo(ni *netmap.NodeInfo) {
ni.SetAddress(a.ma.String())
}
// HostAddr returns host address in string format.
//
// Panics if host address cannot be fetched from Address.

View file

@ -4,7 +4,6 @@ import (
"testing"
"github.com/multiformats/go-multiaddr"
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
"github.com/stretchr/testify/require"
)
@ -66,22 +65,3 @@ func buildMultiaddr(s string, t *testing.T) multiaddr.Multiaddr {
require.NoError(t, err)
return ma
}
func TestAddress_WriteToNodeInfo(t *testing.T) {
a := "127.0.0.1:8080"
var addr Address
err := addr.FromString(a)
require.NoError(t, err)
var ni netmap.NodeInfo
addr.WriteToNodeInfo(&ni)
var restored Address
err = restored.FromString(ni.Address())
require.NoError(t, err)
require.True(t, restored.Equal(addr))
}