decode method Null safety

XdrContractIDPublicKeyType decode(
  1. XdrDataInputStream stream
)

Implementation

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