github.com/evdatsion/aphelion-dpos-bft@v0.32.1/types/encoding_helper.go (about) 1 package types 2 3 import ( 4 cmn "github.com/evdatsion/aphelion-dpos-bft/libs/common" 5 ) 6 7 // cdcEncode returns nil if the input is nil, otherwise returns 8 // cdc.MustMarshalBinaryBare(item) 9 func cdcEncode(item interface{}) []byte { 10 if item != nil && !cmn.IsTypedNil(item) && !cmn.IsEmpty(item) { 11 return cdc.MustMarshalBinaryBare(item) 12 } 13 return nil 14 }