@@ -296,7 +296,9 @@ def test_produce_attestation_basic(self, sample_store: Store) -> None:
296296 slot = Slot (1 )
297297 validator_idx = ValidatorIndex (5 )
298298
299- attestation = sample_store .produce_attestation (slot , validator_idx )
299+ validator = Validator (pubkey = Bytes52 .zero (), index = validator_idx )
300+ attestation_data = sample_store .produce_attestation_data (slot )
301+ attestation = validator .produce_attestation (attestation_data )
300302
301303 # Verify attestation structure
302304 assert attestation .validator_id == validator_idx
@@ -313,7 +315,9 @@ def test_produce_attestation_head_reference(self, sample_store: Store) -> None:
313315 slot = Slot (2 )
314316 validator_idx = ValidatorIndex (8 )
315317
316- attestation = sample_store .produce_attestation (slot , validator_idx )
318+ validator = Validator (pubkey = Bytes52 .zero (), index = validator_idx )
319+ attestation_data = sample_store .produce_attestation_data (slot )
320+ attestation = validator .produce_attestation (attestation_data )
317321
318322 # Head checkpoint should reference the current proposal head
319323 _ , expected_head_root = sample_store .get_proposal_head (slot )
@@ -328,7 +332,9 @@ def test_produce_attestation_target_calculation(self, sample_store: Store) -> No
328332 slot = Slot (3 )
329333 validator_idx = ValidatorIndex (9 )
330334
331- attestation = sample_store .produce_attestation (slot , validator_idx )
335+ validator = Validator (pubkey = Bytes52 .zero (), index = validator_idx )
336+ attestation_data = sample_store .produce_attestation_data (slot )
337+ attestation = validator .produce_attestation (attestation_data )
332338
333339 # Target should match the store's attestation target calculation
334340 expected_target = sample_store .get_attestation_target ()
@@ -342,7 +348,9 @@ def test_produce_attestation_different_validators(self, sample_store: Store) ->
342348 # All validators should produce consistent attestations for the same slot
343349 attestations = []
344350 for validator_idx in range (5 ):
345- attestation = sample_store .produce_attestation (slot , ValidatorIndex (validator_idx ))
351+ validator = Validator (pubkey = Bytes52 .zero (), index = ValidatorIndex (validator_idx ))
352+ attestation_data = sample_store .produce_attestation_data (slot )
353+ attestation = validator .produce_attestation (attestation_data )
346354 attestations .append (attestation )
347355
348356 # Each attestation should have correct validator ID
@@ -362,10 +370,13 @@ def test_produce_attestation_different_validators(self, sample_store: Store) ->
362370 def test_produce_attestation_sequential_slots (self , sample_store : Store ) -> None :
363371 """Test attestation production across sequential slots."""
364372 validator_idx = ValidatorIndex (3 )
373+ validator = Validator (pubkey = Bytes52 .zero (), index = validator_idx )
365374
366375 # Produce attestations for sequential slots
367- attestation1 = sample_store .produce_attestation (Slot (1 ), validator_idx )
368- attestation2 = sample_store .produce_attestation (Slot (2 ), validator_idx )
376+ attestation_data1 = sample_store .produce_attestation_data (Slot (1 ))
377+ attestation1 = validator .produce_attestation (attestation_data1 )
378+ attestation_data2 = sample_store .produce_attestation_data (Slot (2 ))
379+ attestation2 = validator .produce_attestation (attestation_data2 )
369380
370381 # Attestations should be for different slots
371382 assert attestation1 .data .slot == Slot (1 )
@@ -380,7 +391,9 @@ def test_produce_attestation_justification_consistency(self, sample_store: Store
380391 slot = Slot (5 )
381392 validator_idx = ValidatorIndex (2 )
382393
383- attestation = sample_store .produce_attestation (slot , validator_idx )
394+ validator = Validator (pubkey = Bytes52 .zero (), index = validator_idx )
395+ attestation_data = sample_store .produce_attestation_data (slot )
396+ attestation = validator .produce_attestation (attestation_data )
384397
385398 # Source must be the latest justified checkpoint from store
386399 assert attestation .data .source .root == sample_store .latest_justified .root
@@ -406,7 +419,9 @@ def test_block_production_then_attestation(self, sample_store: Store) -> None:
406419 # Other validator creates attestation for slot 2
407420 attestor_slot = Slot (2 )
408421 attestor_idx = ValidatorIndex (7 )
409- attestation = sample_store .produce_attestation (attestor_slot , attestor_idx )
422+ validator = Validator (pubkey = Bytes52 .zero (), index = attestor_idx )
423+ attestation_data = sample_store .produce_attestation_data (attestor_slot )
424+ attestation = validator .produce_attestation (attestation_data )
410425
411426 # Attestation should reference the new block as head (if it became head)
412427 assert attestation .validator_id == attestor_idx
@@ -428,7 +443,9 @@ def test_multiple_validators_coordination(self, sample_store: Store) -> None:
428443 # These will be based on the current forkchoice head (genesis)
429444 attestations = []
430445 for i in range (2 , 6 ):
431- attestation = sample_store .produce_attestation (Slot (2 ), ValidatorIndex (i ))
446+ validator = Validator (pubkey = Bytes52 .zero (), index = ValidatorIndex (i ))
447+ attestation_data = sample_store .produce_attestation_data (Slot (2 ))
448+ attestation = validator .produce_attestation (attestation_data )
432449 attestations .append (attestation )
433450
434451 # All attestations should be consistent
@@ -482,7 +499,9 @@ def test_validator_edge_cases(self, sample_store: Store) -> None:
482499 assert block .proposer_index == max_validator
483500
484501 # Should be able to produce attestation
485- attestation = sample_store .produce_attestation (Slot (10 ), max_validator )
502+ validator = Validator (pubkey = Bytes52 .zero (), index = max_validator )
503+ attestation_data = sample_store .produce_attestation_data (Slot (10 ))
504+ attestation = validator .produce_attestation (attestation_data )
486505 assert attestation .validator_id == max_validator
487506
488507 def test_validator_operations_empty_store (self ) -> None :
@@ -563,7 +582,9 @@ def test_validator_operations_empty_store(self) -> None:
563582 Slot (1 ),
564583 ValidatorIndex (1 ),
565584 )
566- attestation = store .produce_attestation (Slot (1 ), ValidatorIndex (2 ))
585+ validator = Validator (pubkey = Bytes52 .zero (), index = ValidatorIndex (2 ))
586+ attestation_data = store .produce_attestation_data (Slot (1 ))
587+ attestation = validator .produce_attestation (attestation_data )
567588
568589 assert isinstance (block , Block )
569590 assert isinstance (attestation , Attestation )
@@ -621,5 +642,7 @@ def test_validator_operations_invalid_parameters(self, sample_store: Store) -> N
621642 assert isinstance (result , bool )
622643
623644 # produce_attestation should work for any validator
624- attestation = sample_store .produce_attestation (Slot (1 ), large_validator )
645+ validator = Validator (pubkey = Bytes52 .zero (), index = large_validator )
646+ attestation_data = sample_store .produce_attestation_data (Slot (1 ))
647+ attestation = validator .produce_attestation (attestation_data )
625648 assert attestation .validator_id == large_validator
0 commit comments