Skip to content

Commit

Permalink
Merge pull request #55 from starknet-id/fix/returning0_as_hashed_domain
Browse files Browse the repository at this point in the history
fix: return hashed_domain if resolver returns 0
  • Loading branch information
Th0rgal authored May 28, 2024
2 parents 052aabe + aef5a63 commit a62d868
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/naming/internal.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ impl InternalImpl of InternalTrait {
) -> (felt252, felt252) {
let (resolver, parent_start) = self.domain_to_resolver(domain, 1);
if (resolver != ContractAddressZeroable::zero()) {
(
0,
IResolverDispatcher { contract_address: resolver }
.resolve(domain.slice(0, parent_start), field, hint)
)
let resolver_res = IResolverDispatcher { contract_address: resolver }
.resolve(domain.slice(0, parent_start), field, hint);
if resolver_res == 0 {
let hashed_domain = self.hash_domain(domain);
return (0, hashed_domain);
}
return (0, resolver_res);
} else {
let hashed_domain = self.hash_domain(domain);
let domain_data = self._domain_data.read(hashed_domain);
Expand Down

0 comments on commit a62d868

Please sign in to comment.