From 6d0c9d37fa4ac794068bf8509298e66723ebe260 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sun, 23 Jun 2024 15:06:58 +0200 Subject: [PATCH] produce Elctra attestations when running tests (#6383) Test blocks don't include Electra attestations currently so finality breaks and tests fail if prolonged. Fix that. --- tests/testblockutil.nim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/testblockutil.nim b/tests/testblockutil.nim index 15b6c0980..1e8e05a8b 100644 --- a/tests/testblockutil.nim +++ b/tests/testblockutil.nim @@ -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 = @@ -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) \ No newline at end of file + cfg = cfg)