From 8202625c4d47f80cb22339ff0c1b0f5c9ba6d3d8 Mon Sep 17 00:00:00 2001 From: Thomas Marchand Date: Wed, 12 Jun 2024 15:44:24 +0100 Subject: [PATCH] fix: removes custom resolver --- src/naming/internal.cairo | 37 +------------------------------------ src/naming/main.cairo | 2 +- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/src/naming/internal.cairo b/src/naming/internal.cairo index a308322..090926c 100644 --- a/src/naming/internal.cairo +++ b/src/naming/internal.cairo @@ -1,9 +1,6 @@ use core::array::SpanTrait; use naming::{ - interface::{ - resolver::{IResolver, IResolverDispatcher, IResolverDispatcherTrait}, - referral::{IReferral, IReferralDispatcher, IReferralDispatcherTrait}, - }, + interface::referral::{IReferral, IReferralDispatcher, IReferralDispatcherTrait}, naming::main::{ Naming, Naming::{ @@ -161,36 +158,4 @@ impl InternalImpl of InternalTrait { ); } } - - // returns domain_hash (or zero) and its value for a specific field - fn resolve_util( - self: @Naming::ContractState, domain: Span, field: felt252, hint: Span - ) -> (felt252, felt252) { - let (resolver, parent_length) = self.domain_to_resolver(domain); - // if there is a resolver starting from the top - if (resolver != ContractAddressZeroable::zero()) { - let resolver_res = IResolverDispatcher { contract_address: resolver } - .resolve(domain.slice(0, domain.len() - parent_length), field, hint); - if resolver_res == 0 { - let hashed_domain = self.hash_domain(domain); - (hashed_domain, 0) - } else { - (0, resolver_res) - } - } else { - let hashed_domain = self.hash_domain(domain); - let domain_data = self._domain_data.read(hashed_domain); - // if there was a reset subdomains starting from the top - if parent_length != 0 { - (hashed_domain, 0) - // otherwise, we just read the identity - } else { - ( - hashed_domain, - IIdentityDispatcher { contract_address: self.starknetid_contract.read() } - .get_crosschecked_user_data(domain_data.owner, field) - ) - } - } - } } diff --git a/src/naming/main.cairo b/src/naming/main.cairo index fad84c2..e69912f 100644 --- a/src/naming/main.cairo +++ b/src/naming/main.cairo @@ -229,7 +229,7 @@ mod Naming { addr.unwrap() } else { if domain_data.address.into() != 0 { - // no need to check for keys as it was checked in resolve_util + // no need to check for keys as it was checked in domain_to_resolver return domain_data.address; } else { // if no legacy address is found, it returns the identity owner