pub fn to_cbor_bytes<T: Serialize>(val: &T) -> Result<Vec<u8>, ContractError>
Serialize a contract data structure to canonical CBOR bytes.