[#645] *: Use helper functions to build client.NodeInfo structures

Helper functions from core/client package allow to set public keys of
storage nodes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-09-28 08:32:30 +03:00 committed by Alex Vanin
parent 2d441a4cc6
commit e473f3ac91
12 changed files with 67 additions and 107 deletions

View file

@ -5,7 +5,6 @@ import (
"encoding/hex"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
"github.com/nspcc-dev/neofs-node/pkg/network"
putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put"
"go.uber.org/zap"
)
@ -69,20 +68,9 @@ func (p *Replicator) handleTask(ctx context.Context, task *Task) {
log := p.log.With(zap.String("node", hex.EncodeToString(task.nodes[i].PublicKey())))
var node network.AddressGroup
err := node.FromIterator(task.nodes[i])
if err != nil {
log.Error("could not parse network address",
zap.String("error", err.Error()),
)
continue
}
callCtx, cancel := context.WithTimeout(ctx, p.putTimeout)
err = p.remoteSender.PutObject(callCtx, prm.WithNodeAddress(node))
err = p.remoteSender.PutObject(callCtx, prm.WithNodeInfo(task.nodes[i].NodeInfo))
cancel()