You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
343 B

  1. package types
  2. import (
  3. cmn "github.com/tendermint/tendermint/libs/common"
  4. )
  5. // cdcEncode returns nil if the input is nil, otherwise returns
  6. // cdc.MustMarshalBinaryBare(item)
  7. func cdcEncode(item interface{}) []byte {
  8. if item != nil && !cmn.IsTypedNil(item) && !cmn.IsEmpty(item) {
  9. return cdc.MustMarshalBinaryBare(item)
  10. }
  11. return nil
  12. }