[#1570] Upgrade NeoFS SDK Go with changed reputation API

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-07-04 16:24:51 +03:00 committed by LeL
parent 9a6da336db
commit 9a11a75b77
28 changed files with 146 additions and 158 deletions

View file

@ -5,6 +5,7 @@ import (
"sync"
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
apireputation "github.com/nspcc-dev/neofs-sdk-go/reputation"
)
// UpdatePrm groups the parameters of Storage's Update operation.
@ -13,7 +14,7 @@ type UpdatePrm struct {
epoch uint64
peer reputation.PeerID
peer apireputation.PeerID
}
// SetEpoch sets number of the epoch
@ -24,7 +25,7 @@ func (p *UpdatePrm) SetEpoch(e uint64) {
// SetPeer sets identifier of the peer
// with which the local node interacted.
func (p *UpdatePrm) SetPeer(id reputation.PeerID) {
func (p *UpdatePrm) SetPeer(id apireputation.PeerID) {
p.peer = id
}
@ -51,12 +52,13 @@ func newTrustValueStorage() *EpochTrustValueStorage {
}
}
func stringifyPeerID(id reputation.PeerID) string {
return string(id.Bytes())
func stringifyPeerID(id apireputation.PeerID) string {
return string(id.PublicKey())
}
func peerIDFromString(str string) reputation.PeerID {
return reputation.PeerIDFromBytes([]byte(str))
func peerIDFromString(str string) (res apireputation.PeerID) {
res.SetPublicKey([]byte(str))
return
}
func (s *EpochTrustValueStorage) update(prm UpdatePrm) {