[#170] version: Add docs, refactor

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2022-03-23 18:35:44 +03:00 committed by LeL
parent 3e75660802
commit ade8822a2f
21 changed files with 142 additions and 144 deletions

View file

@ -91,7 +91,11 @@ func (c *Client) EndpointInfo(ctx context.Context, prm PrmEndpointInfo) (*ResEnd
body := resp.GetBody()
res.setLatestVersion(version.NewFromV2(body.GetVersion()))
var ver version.Version
if v2ver := body.GetVersion(); v2ver != nil {
ver.ReadFromV2(*v2ver)
}
res.setLatestVersion(&ver)
res.setNodeInfo(netmap.NewNodeInfoFromV2(body.GetNodeInfo()))
}