Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions ens/ens.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
from hexbytes import (
HexBytes,
)
from web3.exceptions import (
ContractLogicError,
)

from . import (
abis,
Expand Down Expand Up @@ -151,10 +154,6 @@ def address(
:raises InvalidName: if `name` has invalid syntax
:raises ResolverNotFound: if no resolver found for `name`
"""
from web3.exceptions import (
ContractLogicError,
)

if coin_type is None:
return cast(ChecksumAddress, self._resolve(name, "addr"))
else:
Expand Down Expand Up @@ -373,10 +372,6 @@ def resolver(self, name: str) -> Optional["Contract"]:

:param str name: The ENS name
"""
from web3.exceptions import (
ContractLogicError,
)

normal_name = normalize_name(name)
dns_name = dns_encode_name(normal_name)
try:
Expand All @@ -403,10 +398,6 @@ def get_text(self, name: str, key: str) -> str:
:rtype: str
:raises ResolverNotFound: If no resolver is found for the provided name
"""
from web3.exceptions import (
ContractLogicError,
)

dns_name, calldata = self._prepare_resolve_call(name, "text", [key])
try:
result, resolver_addr = self._universal_resolver.caller.resolve(
Expand Down Expand Up @@ -487,10 +478,6 @@ def _prepare_resolve_call(
def _resolve(
self, name: str, fn_name: str = "addr"
) -> ChecksumAddress | str | None:
from web3.exceptions import (
ContractLogicError,
)

resolver_contract = (
self._reverse_resolver_contract
if fn_name == "name"
Expand Down