decode method Null safety

XdrSCContractExecutableType decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrSCContractExecutableType decode(XdrDataInputStream stream) {
  int value = stream.readInt();
  switch (value) {
    case 0:
      return SCCONTRACT_EXECUTABLE_WASM_REF;
    case 1:
      return SCCONTRACT_EXECUTABLE_TOKEN;
    default:
      throw Exception("Unknown enum value: $value");
  }
}