File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed
Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change 11import pytest
2-
32import pytest_asyncio
43
54from web3 import (
65 AsyncWeb3 ,
76 Web3 ,
87)
98from web3 .exceptions import (
10- InvalidAddress ,
119 NameNotFound ,
1210)
1311from web3 .middleware import (
@@ -95,7 +93,7 @@ def test_pass_name_resolver_send_transaction_dict_args(
9593
9694
9795def test_fail_name_resolver (w3 ):
98- with pytest .raises (InvalidAddress , match = r".*ethereum\.eth.*" ):
96+ with pytest .raises (NameNotFound , match = r".*ethereum\.eth.*" ):
9997 w3 .eth .get_balance ("ethereum.eth" )
10098
10199
Original file line number Diff line number Diff line change @@ -224,15 +224,7 @@ def abi_ens_resolver(
224224 f"Could not look up name { val !r} because ENS is set to None"
225225 )
226226 else :
227- try :
228- return type_str , validate_name_has_address (_ens , val )
229- except NameNotFound as e :
230- # TODO: This try/except is to keep backwards compatibility when we
231- # removed the mainnet requirement. Remove this in web3.py v7 and allow
232- # NameNotFound to raise.
233- if not isinstance (_ens , StaticENS ):
234- raise InvalidAddress (f"{ e } " )
235- raise e
227+ return type_str , validate_name_has_address (_ens , val )
236228 else :
237229 return type_str , val
238230
You can’t perform that action at this time.
0 commit comments