Skip to content

Commit

Permalink
produce Elctra attestations when running tests (#6383)
Browse files Browse the repository at this point in the history
Test blocks don't include Electra attestations currently so finality
breaks and tests fail if prolonged. Fix that.
  • Loading branch information
etan-status authored Jun 23, 2024
1 parent 9b6b42c commit 6d0c9d3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/testblockutil.nim
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,17 @@ iterator makeTestBlocks*(
let
parent_root = withState(state[]): forkyState.latest_block_root
attestations =
if attested:
if attested and state.kind < ConsensusFork.Electra:
makeFullAttestations(
state[], parent_root, getStateField(state[], slot), cache)
else:
@[]
electraAttestations =
if attested and state.kind >= ConsensusFork.Electra:
makeFullElectraAttestations(
state[], parent_root, getStateField(state[], slot), cache)
else:
@[]
stateEth1 = getStateField(state[], eth1_data)
stateDepositIndex = getStateField(state[], eth1_deposit_index)
deposits =
Expand All @@ -633,7 +639,8 @@ iterator makeTestBlocks*(
state[], cache,
eth1_data = eth1_data,
attestations = attestations,
electraAttestations = electraAttestations,
deposits = deposits,
sync_aggregate = sync_aggregate,
graffiti = graffiti,
cfg = cfg)
cfg = cfg)

0 comments on commit 6d0c9d3

Please sign in to comment.