frostfs-node/pkg/services/reputation/local/route/managers/calls.go
Pavel Karpy 0a16aaacb1 [#482] reputation/router: Use trusting peer
In route building use `trusting` peer
field of `reputation.Trust` struct
instead of `reputation.Peer`.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-04-19 11:47:04 +03:00

23 lines
731 B
Go

package managers
import (
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
reputationroute "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/route"
"github.com/pkg/errors"
)
// NextStage builds Manager list for node and returns it directly.
//
// If passed route has more than one point, then endpoint of the route is reached.
func (b *Builder) NextStage(epoch uint64, t reputation.Trust, passed []reputationroute.ServerInfo) ([]reputationroute.ServerInfo, error) {
if len(passed) > 1 {
return nil, nil
}
route, err := b.managerBuilder.BuildManagers(epoch, t.TrustingPeer())
if err != nil {
return nil, errors.Wrapf(err, "could not build managers for epoch: %d", epoch)
}
return route, nil
}