From 61cc70d89951a8982aaafbc3dab2e40aaffca54e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 23 Jun 2021 12:20:45 +0300 Subject: [PATCH] [#607] network: Remove no longer used `Address.WriteToNodeInfo` method Signed-off-by: Leonard Lyubich --- pkg/network/address.go | 6 ------ pkg/network/address_test.go | 20 -------------------- 2 files changed, 26 deletions(-) diff --git a/pkg/network/address.go b/pkg/network/address.go index 3a34a0cf3..a7831dcfb 100644 --- a/pkg/network/address.go +++ b/pkg/network/address.go @@ -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. diff --git a/pkg/network/address_test.go b/pkg/network/address_test.go index 91f606a85..a293b7ed1 100644 --- a/pkg/network/address_test.go +++ b/pkg/network/address_test.go @@ -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)) -}