[#607] network: Do not return error from Address.HostAddrString method

Panic if internal `manet.DialArgs` call returns error since this is
unexpected according to `AddressFromString` implementation.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-16 14:08:07 +03:00 committed by Leonard Lyubich
parent 4c2d8d5ac9
commit 35f81729e4
6 changed files with 15 additions and 36 deletions

View file

@ -83,12 +83,7 @@ func (p *testPlacementBuilder) BuildPlacement(addr *objectSDK.Address, _ *netmap
}
func (c *testClientCache) get(mAddr *network.Address) (getClient, error) {
hostAddr, err := mAddr.HostAddrString()
if err != nil {
return nil, err
}
v, ok := c.clients[hostAddr]
v, ok := c.clients[mAddr.HostAddrString()]
if !ok {
return nil, errors.New("could not construct client")
}
@ -415,8 +410,7 @@ func testNodeMatrix(t testing.TB, dim []int) ([]netmap.Nodes, [][]string) {
na, err := network.AddressFromString(a)
require.NoError(t, err)
as[j], err = na.HostAddrString()
require.NoError(t, err)
as[j] = na.HostAddrString()
ni := netmap.NewNodeInfo()
ni.SetAddress(a)