ScriptRefType.deserialize constructor

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

Deserializes a ScriptRefType instance from CBOR.

Implementation

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