[#265] pkg/reputation: Implement PeerID and Trust types

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-03-24 11:27:30 +03:00 committed by Leonard Lyubich
parent 51d443c6fc
commit 009f704377
5 changed files with 205 additions and 0 deletions

View file

@ -0,0 +1,22 @@
package reputationtest
import (
"github.com/nspcc-dev/neofs-api-go/pkg/reputation"
crypto "github.com/nspcc-dev/neofs-crypto"
"github.com/nspcc-dev/neofs-crypto/test"
)
func GeneratePeerID() *reputation.PeerID {
v := reputation.NewPeerID()
v.SetBytes(crypto.MarshalPublicKey(&test.DecodeKey(-1).PublicKey))
return v
}
func GenerateTrust() *reputation.Trust {
v := reputation.NewTrust()
v.SetPeer(GeneratePeerID())
v.SetValue(1.5)
return v
}