File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import pytest
2
2
3
+ from web3 .exceptions import (
4
+ ValidationError ,
5
+ )
3
6
from web3 .middleware import (
4
7
construct_fixture_middleware ,
5
8
geth_poa_middleware ,
@@ -12,7 +15,7 @@ def test_long_extra_data(web3):
12
15
'eth_getBlockByNumber' : {'extraData' : '0x' + 'ff' * 33 },
13
16
})
14
17
web3 .middleware_stack .inject (return_block_with_long_extra_data , layer = 0 )
15
- with pytest .raises (ValueError ):
18
+ with pytest .raises (ValidationError ):
16
19
web3 .eth .getBlock ('latest' )
17
20
18
21
Original file line number Diff line number Diff line change 28
28
HexBytes ,
29
29
)
30
30
31
+ from web3 .exceptions import (
32
+ ValidationError ,
33
+ )
31
34
from web3 .utils .encoding import (
32
35
hexstr_if_str ,
33
36
to_hex ,
@@ -70,7 +73,7 @@ def check_extradata_length(val, length):
70
73
return val
71
74
result = HexBytes (val )
72
75
if len (result ) > length :
73
- raise ValueError (
76
+ raise ValidationError (
74
77
"The field extraData: %r is %d bytes, but should be %d. "
75
78
"It is quite likely that you are connected to a POA chain. "
76
79
"Refer "
You can’t perform that action at this time.
0 commit comments