From 5b3ce9e97479c5c0366f2d7f3a9282e5e02e951a Mon Sep 17 00:00:00 2001 From: Iris Date: Mon, 27 May 2024 15:09:25 +0200 Subject: [PATCH 1/2] fix: return hashed_domain if resolver returns 0 --- src/naming/internal.cairo | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/naming/internal.cairo b/src/naming/internal.cairo index 88ac815..4b03b77 100644 --- a/src/naming/internal.cairo +++ b/src/naming/internal.cairo @@ -149,11 +149,14 @@ 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); From aef5a6338804b35567b2d9900e80318177e6dc4d Mon Sep 17 00:00:00 2001 From: Iris Date: Mon, 27 May 2024 15:10:22 +0200 Subject: [PATCH 2/2] fix: remove unecessary space --- src/naming/internal.cairo | 1 - 1 file changed, 1 deletion(-) diff --git a/src/naming/internal.cairo b/src/naming/internal.cairo index 4b03b77..de8fe70 100644 --- a/src/naming/internal.cairo +++ b/src/naming/internal.cairo @@ -154,7 +154,6 @@ impl InternalImpl of InternalTrait { if resolver_res == 0 { let hashed_domain = self.hash_domain(domain); return (0, hashed_domain); - } return (0, resolver_res); } else {