forked from TrueCloudLab/frostfs-api-go
[#265] pkg/reputation: Change PeerID implementation
Make `PeerID` type to be the wrapper over v2 `PeerID` message structure. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
c5000a3334
commit
05a351d344
3 changed files with 123 additions and 21 deletions
|
@ -8,7 +8,11 @@ import (
|
|||
|
||||
func GeneratePeerID() *reputation.PeerID {
|
||||
v := reputation.NewPeerID()
|
||||
v.SetBytes(crypto.MarshalPublicKey(&test.DecodeKey(-1).PublicKey))
|
||||
|
||||
key := [crypto.PublicKeyCompressedSize]byte{}
|
||||
copy(key[:], crypto.MarshalPublicKey(&test.DecodeKey(-1).PublicKey))
|
||||
|
||||
v.SetPublicKey(key)
|
||||
|
||||
return v
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue