@@ -97,11 +97,13 @@ def validate_post_state_fields(self: Any) -> Any:
9797
9898 if field1_value is None and field2_value is None :
9999 raise ValueError (
100- f"Either { field1_name } or { field2_name } must be provided."
100+ f"Either { field1_name } or { field2_name } "
101+ "must be provided."
101102 )
102103 if field1_value is not None and field2_value is not None :
103104 raise ValueError (
104- f"Only one of { field1_name } or { field2_name } must be provided."
105+ f"Only one of { field1_name } or { field2_name } "
106+ "must be provided."
105107 )
106108 return self
107109
@@ -145,8 +147,8 @@ class FixtureHeader(CamelModel):
145147 We combine the `Environment` and `Result` contents to create this model.
146148 """
147149
148- # Allow extra fields: FixtureHeader is constructed from merged Result and
149- # Environment data via model_dump(), which includes fields not in this model .
150+ # Allow extra fields: FixtureHeader is constructed from merged Result
151+ # and Environment data via model_dump(), which has extra fields .
150152 model_config = CamelModel .model_config | {"extra" : "ignore" }
151153
152154 parent_hash : Hash = Hash (0 )
@@ -286,42 +288,51 @@ def get_default_from_annotation(
286288 timestamp : int = 0 ,
287289 ) -> Any :
288290 """
289- Get appropriate default value for a header field based on its type hint.
291+ Get default value for a header field based on its type hint.
290292
291293 This method handles:
292- 1. Fork requirement checking - only returns a default if the fork requires the field
294+ 1. Fork requirement checking - only returns a default if the fork
295+ requires the field
293296 2. Model-defined defaults - uses the field's default value if available
294297 3. Type-based defaults - constructs defaults based on the field type
295298
296299 Args:
297300 fork: Fork to check requirements against
298301 field_name: Name of the field
299302 field_hint: Type annotation of the field
300- block_number: Block number for fork requirement checking (default: 0)
303+ block_number: Block number for fork requirement checking
304+ (default: 0)
301305 timestamp: Timestamp for fork requirement checking (default: 0)
302306
303307 Returns:
304308 Default value appropriate for the field type, or None if
305309 the field is not required by the fork
306310
307311 Raises:
308- TypeError: If the field type is not supported and no default value
309- is defined in the model. This indicates that support for the type
310- needs to be added or an explicit default must be provided.
312+ TypeError: If the field type is not supported and no default
313+ value is defined in the model. This indicates that support
314+ for the type needs to be added or an explicit default must
315+ be provided.
316+
311317 """
312318 # Check if this field has a HeaderForkRequirement annotation
313319 header_fork_requirement = HeaderForkRequirement .get_from_annotation (
314320 field_hint
315321 )
316322 if header_fork_requirement is not None :
317323 # Only provide a default if the fork requires this field
318- if not header_fork_requirement .required (fork , block_number , timestamp ):
324+ if not header_fork_requirement .required (
325+ fork , block_number , timestamp
326+ ):
319327 return None
320328
321329 # Check if the field has a default value defined in the model
322330 if field_name in cls .model_fields :
323331 field_info = cls .model_fields [field_name ]
324- if field_info .default is not None and field_info .default is not PydanticUndefined :
332+ if (
333+ field_info .default is not None
334+ and field_info .default is not PydanticUndefined
335+ ):
325336 return field_info .default
326337 if field_info .default_factory is not None :
327338 return field_info .default_factory () # type: ignore[call-arg]
@@ -339,11 +350,11 @@ def get_default_from_annotation(
339350 elif actual_type == Bytes :
340351 return Bytes (b"" )
341352 else :
342- # Unsupported type - raise an error to catch this during development
353+ # Unsupported type - raise error to catch this during development
343354 raise TypeError (
344355 f"Cannot generate default value for field '{ field_name } ' "
345356 f"with unsupported type '{ actual_type } '. "
346- f "Add support for this type or provide a default value explicitly."
357+ "Add support for this type or provide a default explicitly."
347358 )
348359
349360 @classmethod
@@ -501,7 +512,8 @@ def from_fixture_header(
501512 ):
502513 if block_access_list is None :
503514 raise ValueError (
504- f"`block_access_list` is required in engine `ExecutionPayload` for >={ fork } ."
515+ "`block_access_list` is required in engine "
516+ f"`ExecutionPayload` for >={ fork } ."
505517 )
506518
507519 execution_payload = FixtureExecutionPayload .from_fixture_header (
@@ -609,8 +621,9 @@ class FixtureBlockBase(CamelModel):
609621 @classmethod
610622 def strip_block_number_computed_field (cls , data : Any ) -> Any :
611623 """
612- Strip the block_number computed field which gets included in model_dump()
613- but is not a valid input field.
624+ Strip the block_number computed field included in model_dump().
625+
626+ This field is not a valid input field.
614627 """
615628 if isinstance (data , dict ):
616629 data .pop ("blocknumber" , None )
@@ -785,7 +798,7 @@ class BlockchainEngineXFixture(BlockchainEngineFixtureCommon):
785798 """
786799
787800 # Allow extra fields: BlockchainEngineXFixture is constructed from shared
788- # fixture_data that includes fields for other fixture formats (e.g. genesis).
801+ # fixture_data that has fields for other fixture formats (e.g. genesis).
789802 model_config = CamelModel .model_config | {"extra" : "ignore" }
790803
791804 format_name : ClassVar [str ] = "blockchain_test_engine_x"
@@ -824,7 +837,8 @@ class BlockchainEngineSyncFixture(BlockchainEngineFixture):
824837
825838 format_name : ClassVar [str ] = "blockchain_test_sync"
826839 description : ClassVar [str ] = (
827- "Tests that generate a blockchain test fixture for Engine API testing with client sync."
840+ "Tests that generate a blockchain test fixture for Engine API "
841+ "testing with client sync."
828842 )
829843 sync_payload : FixtureEngineNewPayload | None = None
830844
0 commit comments