Skip to content

Commit

Permalink
Merge pull request #25 from starknet-id/fix/domain_to_id_empty_domain
Browse files Browse the repository at this point in the history
ref: update token_to_id to return 0 when domain is empty
  • Loading branch information
Th0rgal authored Apr 3, 2024
2 parents b11787d + b9b33ba commit 202d72b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/naming/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ 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));
if domain.len() == 0 {
return 0;
};
if domain.len() != 1 {
let parent_key = self
._domain_data
Expand Down

0 comments on commit 202d72b

Please sign in to comment.