Skip to content

Commit

Permalink
ref: update domain_to_id
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Apr 18, 2024
1 parent 90e5070 commit f45b450
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/naming/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ mod Naming {
// This returns the identity (StarknetID) owning the domain
fn domain_to_id(self: @ContractState, domain: Span<felt252>) -> u128 {
let data = self._domain_data.read(self.hash_domain(domain));
// todo: revert when try catch are available
if domain.len() == 0 {
return 0;
};
if domain.len() != 1 {
let parent_key = self
._domain_data
Expand Down

0 comments on commit f45b450

Please sign in to comment.