TransactionDataOptionType.deserialize constructor

TransactionDataOptionType.deserialize(
  1. CborIntValue cbor, {
  2. TransactionDataOptionType? validate,
})

Deserializes a TransactionDataOptionType object from its CBOR representation.

Implementation

factory TransactionDataOptionType.deserialize(CborIntValue cbor,
    {TransactionDataOptionType? validate}) {
  final type = fromValue(cbor.value);
  if (validate != null && validate != type) {
    throw MessageException("Invalid TransactionDataOptionType.",
        details: {"Excepted": validate, "Type": type});
  }
  return type;
}