File tree 2 files changed +2
-13
lines changed
2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 7
7
Web3 ,
8
8
)
9
9
from web3 .exceptions import (
10
- InvalidAddress ,
11
10
NameNotFound ,
12
11
)
13
12
from web3 .middleware import (
@@ -95,7 +94,7 @@ def test_pass_name_resolver_send_transaction_dict_args(
95
94
96
95
97
96
def test_fail_name_resolver (w3 ):
98
- with pytest .raises (InvalidAddress , match = r".*ethereum\.eth.*" ):
97
+ with pytest .raises (NameNotFound , match = r".*ethereum\.eth.*" ):
99
98
w3 .eth .get_balance ("ethereum.eth" )
100
99
101
100
Original file line number Diff line number Diff line change 49
49
text_if_str ,
50
50
)
51
51
from web3 ._utils .ens import (
52
- StaticENS ,
53
52
async_validate_name_has_address ,
54
53
is_ens_name ,
55
54
validate_name_has_address ,
60
59
)
61
60
from web3 .exceptions import (
62
61
InvalidAddress ,
63
- NameNotFound ,
64
62
Web3ValueError ,
65
63
)
66
64
@@ -224,15 +222,7 @@ def abi_ens_resolver(
224
222
f"Could not look up name { val !r} because ENS is set to None"
225
223
)
226
224
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 )
236
226
else :
237
227
return type_str , val
238
228
You can’t perform that action at this time.
0 commit comments