getValidation method

  1. @override
Validation getValidation(
  1. AttestationResponse? attestation,
  2. Uri? metadataUri
)
override

Implementation

@override
Validation getValidation(
  AttestationResponse? attestation,
  Uri? metadataUri,
) {
  if (attestation?.isScam == true) {
    return Validation.SCAM;
  }

  if ((attestation?.origin ?? '').isEmpty ||
      (metadataUri?.origin ?? '').isEmpty) {
    return Validation.INVALID;
  }

  return attestation!.origin == metadataUri!.origin
      ? Validation.VALID
      : Validation.INVALID;
}