mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
15 lines
343 B
Go
15 lines
343 B
Go
|
package types
|
||
|
|
||
|
import (
|
||
|
cmn "github.com/tendermint/tendermint/libs/common"
|
||
|
)
|
||
|
|
||
|
// cdcEncode returns nil if the input is nil, otherwise returns
|
||
|
// cdc.MustMarshalBinaryBare(item)
|
||
|
func cdcEncode(item interface{}) []byte {
|
||
|
if item != nil && !cmn.IsTypedNil(item) && !cmn.IsEmpty(item) {
|
||
|
return cdc.MustMarshalBinaryBare(item)
|
||
|
}
|
||
|
return nil
|
||
|
}
|