Open
Description
What is the current behavior?
There is a try/except NameNotFound
block in abi_ens_resolver
that was marked with a TODO comment to remove it in Web3.py v7. Specifically:
try:
return type_str, validate_name_has_address(_ens, val)
except NameNotFound as e:
# TODO: This try/except is to keep backwards compatibility when we
# removed the mainnet requirement. Remove this in web3.py v7 and allow
# NameNotFound to raise.
if not isinstance(_ens, StaticENS):
raise InvalidAddress(f"{e}")
raise e
This backward compatibility handling catches NameNotFound
and converts it to InvalidAddress
(unless _ens
is a StaticENS
). According to the comment, we intended to remove this logic once we no longer required backward compatibility for mainnet-only ENS.
What should happen?
- The
try/except
block should be removed so thatNameNotFound
is raised directly as intended in Web3.py v7. - Code paths that depend on this legacy behavior should be updated or removed, and associated tests should be adjusted accordingly.
Additional context
- I’ve already prepared a PR that removes this code. This Issue is just to track the change and generate an Issue number for cross-referencing.
- If maintainers have feedback on timing (e.g., if it should wait for the next major release), we can discuss in this thread.
Metadata
Metadata
Assignees
Labels
No labels