[#549] network/cache: Change Get signature

Make network cache's `Get` method accept
`network.Address` argument instead of
string.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-05-20 18:17:16 +03:00 committed by Alex Vanin
parent e10981a7d3
commit 33bef46f31
19 changed files with 83 additions and 85 deletions

View file

@ -80,8 +80,13 @@ func (p *testPlacementBuilder) BuildPlacement(addr *objectSDK.Address, _ *netmap
return vs, nil
}
func (c *testClientCache) get(addr string) (getClient, error) {
v, ok := c.clients[addr]
func (c *testClientCache) get(mAddr *network.Address) (getClient, error) {
hostAddr, err := mAddr.HostAddrString()
if err != nil {
return nil, err
}
v, ok := c.clients[hostAddr]
if !ok {
return nil, errors.New("could not construct client")
}