File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 77 Web3 ,
88)
99from web3 .exceptions import (
10- InvalidAddress ,
1110 NameNotFound ,
1211)
1312from web3 .middleware import (
@@ -95,7 +94,7 @@ def test_pass_name_resolver_send_transaction_dict_args(
9594
9695
9796def test_fail_name_resolver (w3 ):
98- with pytest .raises (InvalidAddress , match = r".*ethereum\.eth.*" ):
97+ with pytest .raises (NameNotFound , match = r".*ethereum\.eth.*" ):
9998 w3 .eth .get_balance ("ethereum.eth" )
10099
101100
Original file line number Diff line number Diff line change 4949 text_if_str ,
5050)
5151from web3 ._utils .ens import (
52- StaticENS ,
5352 async_validate_name_has_address ,
5453 is_ens_name ,
5554 validate_name_has_address ,
6059)
6160from web3 .exceptions import (
6261 InvalidAddress ,
63- NameNotFound ,
6462 Web3ValueError ,
6563)
6664
@@ -224,15 +222,7 @@ def abi_ens_resolver(
224222 f"Could not look up name { val !r} because ENS is set to None"
225223 )
226224 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
225+ return type_str , validate_name_has_address (_ens , val )
236226 else :
237227 return type_str , val
238228
You can’t perform that action at this time.
0 commit comments