[#265] pkg/reputation: Implement PeerID and Trust types
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
51d443c6fc
commit
009f704377
5 changed files with 205 additions and 0 deletions
22
pkg/reputation/test/generate.go
Normal file
22
pkg/reputation/test/generate.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue