github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/types/encoding_helper.go (about)

     1  package types
     2  
     3  // cdcEncode returns nil if the input is nil, otherwise returns
     4  // cdc.MustMarshalBinaryBare(item)
     5  func cdcEncode(item interface{}) []byte {
     6  	if item != nil && !isTypedNil(item) && !isEmpty(item) {
     7  		return cdc.MustMarshalBinaryBare(item)
     8  	}
     9  	return nil
    10  }