[#265] pkg/reputation: Implement PeerToPeerTrust structure

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-04-09 11:39:25 +03:00 committed by Leonard Lyubich
parent 269288119d
commit a61c15b990
3 changed files with 135 additions and 0 deletions

View file

@ -28,6 +28,14 @@ func GenerateTrust() *reputation.Trust {
return v
}
func GeneratePeerToPeerTrust() *reputation.PeerToPeerTrust {
v := reputation.NewPeerToPeerTrust()
v.SetTrustingPeer(GeneratePeerID())
v.SetTrust(GenerateTrust())
return v
}
func GenerateGlobalTrust() *reputation.GlobalTrust {
v := reputation.NewGlobalTrust()
v.SetManager(GeneratePeerID())