forked from TrueCloudLab/frostfs-node
[#488] reputation/eigentrust/storages: Fix args
Change anonymous func arg for `Iterate` methods of Storages to `PeerTrustsHandler` type for implementing corresponding interface. Implement missing `Iterate` method for daughter Storage. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
35ec694b04
commit
e2a1b0e0ee
2 changed files with 34 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/reputation/eigentrust"
|
||||
eigentrustcalc "github.com/nspcc-dev/neofs-node/pkg/services/reputation/eigentrust/calculator"
|
||||
)
|
||||
|
||||
// Put saves intermediate trust of the consumer to daughter peer.
|
||||
|
@ -135,7 +136,7 @@ func (x *ConsumersStorage) put(trust eigentrust.IterationTrust) {
|
|||
// Iterate passes IDs of the daughter peers with the trusts of their consumers to h.
|
||||
//
|
||||
// Returns errors from h directly.
|
||||
func (x *ConsumersStorage) Iterate(h func(trusted reputation.PeerID, consumerTrusts *ConsumersTrusts) error) (err error) {
|
||||
func (x *ConsumersStorage) Iterate(h eigentrustcalc.PeerTrustsHandler) (err error) {
|
||||
x.mtx.RLock()
|
||||
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue