Skip to content

Commit

Permalink
fix: overriding a subdomain by a root domain (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal authored Jan 12, 2024
1 parent b327ec1 commit 6e45f7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/naming/internal.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ impl InternalImpl of InternalTrait {
fn set_address_to_domain_util(
ref self: Naming::ContractState, address: ContractAddress, mut domain: Span<felt252>
) {
match domain.pop_back() {
Option::Some(domain_part) => {
self._address_to_domain.write((address, domain.len()), *domain_part);
self.set_address_to_domain_util(address, domain)
},
Option::None => {}
}
self._address_to_domain.write((address, domain.len()), 0);
loop {
match domain.pop_back() {
Option::Some(domain_part) => {
self._address_to_domain.write((address, domain.len()), *domain_part);
},
Option::None => { break; }
}
};
}

fn domain_to_resolver(
Expand Down
1 change: 0 additions & 1 deletion src/naming/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ mod Naming {
}
}


// EXTERNAL

fn buy(
Expand Down

0 comments on commit 6e45f7f

Please sign in to comment.