You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
returntype_str, validate_name_has_address(_ens, val)
exceptNameNotFoundase:
# 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.ifnotisinstance(_ens, StaticENS):
raiseInvalidAddress(f"{e}")
raisee
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 that NameNotFound 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.
The text was updated successfully, but these errors were encountered:
What is the current behavior?
There is a
try/except NameNotFound
block inabi_ens_resolver
that was marked with a TODO comment to remove it in Web3.py v7. Specifically:This backward compatibility handling catches
NameNotFound
and converts it toInvalidAddress
(unless_ens
is aStaticENS
). According to the comment, we intended to remove this logic once we no longer required backward compatibility for mainnet-only ENS.What should happen?
try/except
block should be removed so thatNameNotFound
is raised directly as intended in Web3.py v7.Additional context
The text was updated successfully, but these errors were encountered: