Skip to content

Commit 65fdff7

Browse files
committed
Move change to validate_gas for easier diffs
Putting it back in the original spot from before the branch makes it easier to see what changed.
1 parent f8f20cf commit 65fdff7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

eth/validation.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ def validate_vm_configuration(vm_configuration: Tuple[Tuple[int, Type[VirtualMac
228228
))
229229

230230

231+
def validate_gas_limit(gas_limit: int, parent_gas_limit: int) -> None:
232+
low_bound, high_bound = compute_gas_limit_bounds(parent_gas_limit)
233+
if gas_limit < low_bound:
234+
raise ValidationError(
235+
f"The gas limit {gas_limit} is too low. It must be at least {low_bound}"
236+
)
237+
elif gas_limit > high_bound:
238+
raise ValidationError(
239+
f"The gas limit {gas_limit} is too high. It must be at most {high_bound}"
240+
)
241+
242+
231243
ALLOWED_HEADER_FIELDS = {
232244
'coinbase',
233245
'difficulty',
@@ -250,15 +262,3 @@ def validate_header_params_for_configuration(header_params: Dict[str, Any]) -> N
250262
f"({', '.join(tuple(sorted(ALLOWED_HEADER_FIELDS)))}). "
251263
f"The provided fields ({', '.join(tuple(sorted(extra_fields)))}) are not supported"
252264
)
253-
254-
255-
def validate_gas_limit(gas_limit: int, parent_gas_limit: int) -> None:
256-
low_bound, high_bound = compute_gas_limit_bounds(parent_gas_limit)
257-
if gas_limit < low_bound:
258-
raise ValidationError(
259-
f"The gas limit {gas_limit} is too low. It must be at least {low_bound}"
260-
)
261-
elif gas_limit > high_bound:
262-
raise ValidationError(
263-
f"The gas limit {gas_limit} is too high. It must be at most {high_bound}"
264-
)

0 commit comments

Comments
 (0)