Skip to content

Commit d18b78e

Browse files
committed
Unify ValidationError
1 parent dee977e commit d18b78e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+163
-160
lines changed

eth/chains/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from eth_utils import (
3737
to_tuple,
3838
to_set,
39+
ValidationError,
3940
)
4041

4142
from eth.db.backends.base import BaseDB
@@ -56,7 +57,6 @@
5657
from eth.exceptions import (
5758
HeaderNotFound,
5859
TransactionNotFound,
59-
ValidationError,
6060
VMNotFound,
6161
)
6262
from eth.utils.spoof import (

eth/chains/mainnet/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from eth_utils import (
44
decode_hex,
55
encode_hex,
6+
ValidationError,
67
)
78

89
from .constants import (
@@ -17,7 +18,6 @@
1718
from eth.chains.base import (
1819
Chain,
1920
)
20-
from eth.exceptions import ValidationError
2121
from eth.rlp.headers import BlockHeader
2222
from eth.vm.base import BaseVM # noqa: F401
2323
from eth.vm.forks import (

eth/chains/shard.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
from eth_typing import (
55
Hash32,
66
)
7-
7+
from eth_utils import (
8+
ValidationError,
9+
)
810
from eth.db.shard import (
911
Availability,
1012
ShardDB,
1113
)
12-
13-
from eth.exceptions import (
14-
ValidationError,
15-
)
16-
1714
from eth.rlp.headers import (
1815
CollationHeader,
1916
)

eth/chains/tester/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
from eth_utils import (
1818
to_tuple,
19+
ValidationError,
1920
)
2021

2122
from eth.chains.base import Chain
2223
from eth.chains.mainnet import MainnetChain
23-
from eth.exceptions import ValidationError
2424
from eth.rlp.headers import (
2525
BlockHeader
2626
)

eth/consensus/pow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
from eth_typing import (
1414
Hash32
1515
)
16+
from eth_utils import (
17+
ValidationError,
18+
)
1619

1720
from eth_hash.auto import keccak
1821

1922
from eth.utils.hexadecimal import (
2023
encode_hex,
2124
)
22-
from eth.exceptions import (
23-
ValidationError,
24-
)
2525
from eth.utils.numeric import (
2626
big_endian_to_int,
2727
)

eth/db/chain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from eth_utils import (
2828
to_list,
2929
to_tuple,
30+
ValidationError,
3031
)
3132

3233
from eth_hash.auto import keccak
@@ -40,7 +41,6 @@
4041
HeaderNotFound,
4142
ParentNotFound,
4243
TransactionNotFound,
43-
ValidationError,
4444
)
4545
from eth.db.header import BaseHeaderDB, HeaderDB
4646
from eth.db.backends.base import (

eth/db/journal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
merge,
88
last,
99
)
10+
from eth_utils import (
11+
ValidationError,
12+
)
1013

1114
from eth.db.backends.base import BaseDB
12-
from eth.exceptions import ValidationError
1315

1416

1517
class DeletedEntry:

eth/exceptions.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ class CanonicalCollationNotFound(PyEVMError):
7474
pass
7575

7676

77-
class ValidationError(PyEVMError):
78-
"""
79-
Raised when something does not pass a validation check.
80-
"""
81-
pass
82-
83-
8477
class Halt(PyEVMError):
8578
"""
8679
Raised when an opcode function halts vm execution.

eth/precompiles/ecadd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
optimized_bn128 as bn128,
33
)
44

5+
from eth_utils import (
6+
ValidationError,
7+
)
8+
59
from eth import constants
10+
611
from eth.exceptions import (
7-
ValidationError,
812
VMError,
913
)
1014
from eth.utils.bn128 import (

eth/precompiles/ecmul.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
optimized_bn128 as bn128,
33
)
44

5+
from eth_utils import (
6+
ValidationError,
7+
)
8+
59
from eth import constants
10+
611
from eth.exceptions import (
7-
ValidationError,
812
VMError,
913
)
1014
from eth.utils.bn128 import (

0 commit comments

Comments
 (0)