[#302] pkg/reputation: Document default values set in NewPeerID

Document field values of instance constructed via `NewPeerID`.
Assert the values in corresponding unit test.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-06-08 19:57:28 +03:00 committed by Alex Vanin
parent d4327ec018
commit cce7ecbc00
2 changed files with 28 additions and 6 deletions

View file

@ -12,6 +12,9 @@ import (
type PeerID reputation.PeerID
// NewPeerID creates and returns blank PeerID.
//
// Defaults:
// - publicKey: nil.
func NewPeerID() *PeerID {
return PeerIDFromV2(new(reputation.PeerID))
}