Skip to content

fix: getname behaviour#270

Open
TateB wants to merge 2 commits intomainfrom
fix/getname-behaviour
Open

fix: getname behaviour#270
TateB wants to merge 2 commits intomainfrom
fix/getname-behaviour

Conversation

@TateB
Copy link
Member

@TateB TateB commented Nov 12, 2025

if a resolved primary name is not normalised, the result should be null or an error, rather than normalising the output. this was theoretically being tested already but createSubname and setAddressRecord both use the namehash function in ensjs itself, which normalises all labels, and we weren't testing for the error output in strict mode, just that the result is null.

changes:

  • added normalisation check in getName. if false (not normalised), there is a new NameNotNormalisedError that can be thrown in strict mode, or non strict will return null.
  • getName test now uses writeContract + viem's namehash to avoid the normalisation in the namehash from ensjs
  • waitForTransaction now checks that a transaction was successful in it's receipt

@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@v1rtl
Copy link
Collaborator

v1rtl commented Nov 12, 2025

Test fail with an unrelated error, but otherwise seems fine. The main branch isn't the one that will be used in the future but I suppose we can backport it to the refactor branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants