mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 17:51:39 +00:00
Add helper methods for nil checks in structs
This commit is contained in:
@ -53,6 +53,10 @@ func (p *PrivKeyS) UnmarshalJSON(data []byte) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (p PrivKeyS) Empty() bool {
|
||||
return p.PrivKey == nil
|
||||
}
|
||||
|
||||
func PrivKeyFromBytes(privKeyBytes []byte) (privKey PrivKey, err error) {
|
||||
err = wire.ReadBinaryBytes(privKeyBytes, &privKey)
|
||||
return
|
||||
|
Reference in New Issue
Block a user