[#607] network: Remove no longer used Address.WriteToNodeInfo
method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
149367cab9
commit
61cc70d899
2 changed files with 0 additions and 26 deletions
|
@ -7,7 +7,6 @@ import (
|
||||||
|
|
||||||
"github.com/multiformats/go-multiaddr"
|
"github.com/multiformats/go-multiaddr"
|
||||||
manet "github.com/multiformats/go-multiaddr/net"
|
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)
|
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.
|
// HostAddr returns host address in string format.
|
||||||
//
|
//
|
||||||
// Panics if host address cannot be fetched from Address.
|
// Panics if host address cannot be fetched from Address.
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/multiformats/go-multiaddr"
|
"github.com/multiformats/go-multiaddr"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,22 +65,3 @@ func buildMultiaddr(s string, t *testing.T) multiaddr.Multiaddr {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
return ma
|
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))
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue