From 25ff699425cbd558b56161e2da2cba19a395e308 Mon Sep 17 00:00:00 2001 From: Alexander Simmerl Date: Tue, 6 Mar 2018 16:00:44 +0100 Subject: [PATCH] Improve method docs --- types/priv_validator/json.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/priv_validator/json.go b/types/priv_validator/json.go index 23c5d3e22..3acaa6e2f 100644 --- a/types/priv_validator/json.go +++ b/types/priv_validator/json.go @@ -24,12 +24,12 @@ func (pk PrivKey) Sign(msg []byte) (crypto.Signature, error) { return crypto.PrivKey(pk).Sign(msg), nil } -// MarshalJSON +// MarshalJSON satisfies json.Marshaler. func (pk PrivKey) MarshalJSON() ([]byte, error) { return crypto.PrivKey(pk).MarshalJSON() } -// UnmarshalJSON +// UnmarshalJSON satisfies json.Unmarshaler. func (pk *PrivKey) UnmarshalJSON(b []byte) error { cpk := new(crypto.PrivKey) if err := cpk.UnmarshalJSON(b); err != nil { @@ -83,6 +83,7 @@ func (pvj *PrivValidatorJSON) String() string { return fmt.Sprintf("PrivValidator{%v %v}", addr, pvj.PrivValidatorUnencrypted.String()) } +// Save persists the PrivValidatorJSON to disk. func (pvj *PrivValidatorJSON) Save() { pvj.save() } @@ -167,6 +168,8 @@ func NewTestPrivValidator(signer types.TestSigner) *PrivValidatorJSON { //------------------------------------------------------ +// PrivValidatorsByAddress is a list of PrivValidatorJSON ordered by their +// addresses. type PrivValidatorsByAddress []*PrivValidatorJSON func (pvs PrivValidatorsByAddress) Len() int {