RelayType.deserialize constructor
RelayType.deserialize(
- CborIntValue cbor, {
- RelayType? validate,
Deserialize a RelayType from a CBOR integer value.
Implementation
factory RelayType.deserialize(CborIntValue cbor, {RelayType? validate}) {
final type = fromValue(cbor.value);
if (validate != null && type != validate) {
throw MessageException("Invalid RelayType.",
details: {"Expected": validate, "Type": type});
}
return fromValue(cbor.value);
}