Skip to content

Commit

Permalink
fix: removes custom resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal committed Jun 12, 2024
1 parent be20819 commit 8202625
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
37 changes: 1 addition & 36 deletions src/naming/internal.cairo
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down Expand Up @@ -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<felt252>, field: felt252, hint: Span<felt252>
) -> (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)
)
}
}
}
}
2 changes: 1 addition & 1 deletion src/naming/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8202625

Please sign in to comment.