File tree Expand file tree Collapse file tree 26 files changed +88
-88
lines changed Expand file tree Collapse file tree 26 files changed +88
-88
lines changed Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .exceptions import TransactionTypeError
19
19
from .fork_types import Address
@@ -146,14 +146,14 @@ def validate_transaction(tx: Transaction) -> Uint:
146
146
147
147
Raises
148
148
------
149
- InvalidBlock :
149
+ InvalidTransaction :
150
150
If the transaction is not valid.
151
151
"""
152
152
intrinsic_gas = calculate_intrinsic_cost (tx )
153
153
if intrinsic_gas > tx .gas :
154
- raise InvalidBlock
154
+ raise InvalidTransaction ( "Insufficient gas" )
155
155
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
156
- raise InvalidBlock
156
+ raise InvalidTransaction ( "Nonce too high" )
157
157
return intrinsic_gas
158
158
159
159
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .exceptions import TransactionTypeError
19
19
from .fork_types import Address
@@ -118,14 +118,14 @@ def validate_transaction(tx: Transaction) -> Uint:
118
118
119
119
Raises
120
120
------
121
- InvalidBlock :
121
+ InvalidTransaction :
122
122
If the transaction is not valid.
123
123
"""
124
124
intrinsic_gas = calculate_intrinsic_cost (tx )
125
125
if intrinsic_gas > tx .gas :
126
- raise InvalidBlock
126
+ raise InvalidTransaction ( "Insufficient gas" )
127
127
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
128
- raise InvalidBlock
128
+ raise InvalidTransaction ( "Nonce too high" )
129
129
return intrinsic_gas
130
130
131
131
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .fork_types import Address
19
19
@@ -68,14 +68,14 @@ def validate_transaction(tx: Transaction) -> Uint:
68
68
69
69
Raises
70
70
------
71
- InvalidBlock :
71
+ InvalidTransaction :
72
72
If the transaction is not valid.
73
73
"""
74
74
intrinsic_gas = calculate_intrinsic_cost (tx )
75
75
if intrinsic_gas > tx .gas :
76
- raise InvalidBlock
76
+ raise InvalidTransaction ( "Insufficient gas" )
77
77
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
78
- raise InvalidBlock
78
+ raise InvalidTransaction ( "Nonce too high" )
79
79
return intrinsic_gas
80
80
81
81
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .exceptions import TransactionTypeError
19
19
from .fork_types import Address , VersionedHash
@@ -176,18 +176,18 @@ def validate_transaction(tx: Transaction) -> Uint:
176
176
177
177
Raises
178
178
------
179
- InvalidBlock :
179
+ InvalidTransaction :
180
180
If the transaction is not valid.
181
181
"""
182
182
from .vm .interpreter import MAX_CODE_SIZE
183
183
184
184
intrinsic_gas = calculate_intrinsic_cost (tx )
185
185
if intrinsic_gas > tx .gas :
186
- raise InvalidBlock
186
+ raise InvalidTransaction ( "Insufficient gas" )
187
187
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
188
- raise InvalidBlock
188
+ raise InvalidTransaction ( "Nonce too high" )
189
189
if tx .to == Bytes0 (b"" ) and len (tx .data ) > 2 * MAX_CODE_SIZE :
190
- raise InvalidBlock
190
+ raise InvalidTransaction ( "Code size too large" )
191
191
192
192
return intrinsic_gas
193
193
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .fork_types import Address
19
19
@@ -68,14 +68,14 @@ def validate_transaction(tx: Transaction) -> Uint:
68
68
69
69
Raises
70
70
------
71
- InvalidBlock :
71
+ InvalidTransaction :
72
72
If the transaction is not valid.
73
73
"""
74
74
intrinsic_gas = calculate_intrinsic_cost (tx )
75
75
if intrinsic_gas > tx .gas :
76
- raise InvalidBlock
76
+ raise InvalidTransaction ( "Insufficient gas" )
77
77
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
78
- raise InvalidBlock
78
+ raise InvalidTransaction ( "Nonce too high" )
79
79
return intrinsic_gas
80
80
81
81
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .fork_types import Address
19
19
@@ -68,14 +68,14 @@ def validate_transaction(tx: Transaction) -> Uint:
68
68
69
69
Raises
70
70
------
71
- InvalidBlock :
71
+ InvalidTransaction :
72
72
If the transaction is not valid.
73
73
"""
74
74
intrinsic_gas = calculate_intrinsic_cost (tx )
75
75
if intrinsic_gas > tx .gas :
76
- raise InvalidBlock
76
+ raise InvalidTransaction ( "Insufficient gas" )
77
77
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
78
- raise InvalidBlock
78
+ raise InvalidTransaction ( "Nonce too high" )
79
79
return intrinsic_gas
80
80
81
81
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .fork_types import Address
19
19
@@ -67,14 +67,14 @@ def validate_transaction(tx: Transaction) -> Uint:
67
67
68
68
Raises
69
69
------
70
- InvalidBlock :
70
+ InvalidTransaction :
71
71
If the transaction is not valid.
72
72
"""
73
73
intrinsic_gas = calculate_intrinsic_cost (tx )
74
74
if intrinsic_gas > tx .gas :
75
- raise InvalidBlock
75
+ raise InvalidTransaction ( "insufficient gas" )
76
76
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
77
- raise InvalidBlock
77
+ raise InvalidTransaction ( "nonce too high" )
78
78
return intrinsic_gas
79
79
80
80
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .exceptions import TransactionTypeError
19
19
from .fork_types import Address
@@ -146,14 +146,14 @@ def validate_transaction(tx: Transaction) -> Uint:
146
146
147
147
Raises
148
148
------
149
- InvalidBlock :
149
+ InvalidTransaction :
150
150
If the transaction is not valid.
151
151
"""
152
152
intrinsic_gas = calculate_intrinsic_cost (tx )
153
153
if intrinsic_gas > tx .gas :
154
- raise InvalidBlock
154
+ raise InvalidTransaction ( "Insufficient gas" )
155
155
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
156
- raise InvalidBlock
156
+ raise InvalidTransaction ( "Nonce too high" )
157
157
return intrinsic_gas
158
158
159
159
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .fork_types import Address
19
19
@@ -68,14 +68,14 @@ def validate_transaction(tx: Transaction) -> Uint:
68
68
69
69
Raises
70
70
------
71
- InvalidBlock :
71
+ InvalidTransaction :
72
72
If the transaction is not valid.
73
73
"""
74
74
intrinsic_gas = calculate_intrinsic_cost (tx )
75
75
if intrinsic_gas > tx .gas :
76
- raise InvalidBlock
76
+ raise InvalidTransaction ( "Insufficient gas" )
77
77
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
78
- raise InvalidBlock
78
+ raise InvalidTransaction ( "Nonce too high" )
79
79
return intrinsic_gas
80
80
81
81
Original file line number Diff line number Diff line change 13
13
14
14
from ethereum .crypto .elliptic_curve import SECP256K1N , secp256k1_recover
15
15
from ethereum .crypto .hash import Hash32 , keccak256
16
- from ethereum .exceptions import InvalidBlock , InvalidSignatureError
16
+ from ethereum .exceptions import InvalidSignatureError , InvalidTransaction
17
17
18
18
from .fork_types import Address
19
19
@@ -68,14 +68,14 @@ def validate_transaction(tx: Transaction) -> Uint:
68
68
69
69
Raises
70
70
------
71
- InvalidBlock :
71
+ InvalidTransaction :
72
72
If the transaction is not valid.
73
73
"""
74
74
intrinsic_gas = calculate_intrinsic_cost (tx )
75
75
if intrinsic_gas > tx .gas :
76
- raise InvalidBlock
76
+ raise InvalidTransaction ( "Insufficient gas" )
77
77
if U256 (tx .nonce ) >= U256 (U64 .MAX_VALUE ):
78
- raise InvalidBlock
78
+ raise InvalidTransaction ( "Nonce too high" )
79
79
return intrinsic_gas
80
80
81
81
You can’t perform that action at this time.
0 commit comments