def _evaluate_kyc_data(self, command: offchain.Command) -> typing.Tuple[ActionResultType, offchain.Command]: command = typing.cast(offchain.PaymentCommand, command) op_kyc_data = command.opponent_actor_obj().kyc_data assert op_kyc_data is not None ret = self.evaluate_kyc_data_result.get(str(op_kyc_data.given_name), ActionResult.PASS) if ret == ActionResult.SOFT_MATCH: return (ret, command.new_command(status=offchain.Status.soft_match)) return (ret, self._kyc_data_result("evaluate key data", ret, command))
def _send_additional_kyc_data(self, command: offchain.Command) -> typing.Tuple[ActionResultType, offchain.Command]: command = typing.cast(offchain.PaymentCommand, command) account_id = command.my_actor_obj().address _, subaddress = identifier.decode_account(account_id, self.hrp) if subaddress: user = self._find_user_by_subaddress(subaddress) else: raise ValueError(f"{account_id} has no sub-address") new_cmd = command.new_command(additional_kyc_data=user.additional_kyc_data()) return (ActionResult.SENT_ADDITIONAL_KYC_DATA, new_cmd)