diff --git a/packages/beacon-node/test/spec/presets/operations.test.ts b/packages/beacon-node/test/spec/presets/operations.test.ts index fe70c091aa5a..de8a32a6056a 100644 --- a/packages/beacon-node/test/spec/presets/operations.test.ts +++ b/packages/beacon-node/test/spec/presets/operations.test.ts @@ -138,12 +138,12 @@ const operations: TestRunnerFn = (fork, sszTypes: { pre: ssz[fork].BeaconState, post: ssz[fork].BeaconState, - attestation: fork === ForkName.electra ? ssz.electra.Attestation : ssz.phase0.Attestation, - attester_slashing: fork === ForkName.electra ? ssz.electra.AttesterSlashing : ssz.phase0.AttesterSlashing, + attestation: ssz.allForks[fork].Attestation, + attester_slashing: ssz.allForks[fork].AttesterSlashing, block: ssz[fork].BeaconBlock, body: ssz[fork].BeaconBlockBody, deposit: ssz.phase0.Deposit, - deposit_receipt: ssz.electra.DepositRequest, + deposit_receipt: ssz.electra.DepositReceipt, proposer_slashing: ssz.phase0.ProposerSlashing, voluntary_exit: ssz.phase0.SignedVoluntaryExit, // Altair @@ -155,6 +155,7 @@ const operations: TestRunnerFn = (fork, : ssz.bellatrix.ExecutionPayload, // Capella address_change: ssz.capella.SignedBLSToExecutionChange, + // Electra consolidation: ssz.electra.SignedConsolidation, execution_layer_withdrawal_request: ssz.electra.ExecutionLayerWithdrawalRequest, }, diff --git a/packages/beacon-node/test/spec/presets/ssz_static.test.ts b/packages/beacon-node/test/spec/presets/ssz_static.test.ts index cca6bb57c308..ad828d5b5bb9 100644 --- a/packages/beacon-node/test/spec/presets/ssz_static.test.ts +++ b/packages/beacon-node/test/spec/presets/ssz_static.test.ts @@ -2,8 +2,13 @@ import fs from "node:fs"; import path from "node:path"; import {it, vi} from "vitest"; import {Type} from "@chainsafe/ssz"; +<<<<<<< HEAD import {ssz, sszTypesFor} from "@lodestar/types"; import {ACTIVE_PRESET, ForkName} from "@lodestar/params"; +======= +import {ssz} from "@lodestar/types"; +import {ACTIVE_PRESET, ForkName, ForkLightClient, ForkExecution} from "@lodestar/params"; +>>>>>>> 82d0692d63d (test: fix ssz_static spec tests for all forks (#6771)) import {replaceUintTypeWithUintBigintType} from "../utils/replaceUintTypeWithUintBigintType.js"; import {parseSszStaticTestcase} from "../utils/sszTestCaseParser.js"; import {runValidSszTest} from "../utils/runValidSszTest.js"; diff --git a/packages/params/src/index.ts b/packages/params/src/index.ts index 20439568156e..0c2e3b34794b 100644 --- a/packages/params/src/index.ts +++ b/packages/params/src/index.ts @@ -267,4 +267,4 @@ export const FULL_EXIT_REQUEST_AMOUNT = 0; export const NEXT_SYNC_COMMITTEE_GINDEX_ELECTRA = 87; export const NEXT_SYNC_COMMITTEE_DEPTH_ELECTRA = 6; export const FINALIZED_ROOT_DEPTH_ELECTRA = 7; -export const FINALIZED_ROOT_INDEX_ELECTRA = 169; \ No newline at end of file +export const FINALIZED_ROOT_INDEX_ELECTRA = 169; diff --git a/packages/types/src/electra/sszTypes.ts b/packages/types/src/electra/sszTypes.ts index b2191215eb2c..0aa2872c3a73 100644 --- a/packages/types/src/electra/sszTypes.ts +++ b/packages/types/src/electra/sszTypes.ts @@ -277,10 +277,7 @@ export const PendingBalanceDeposit = new ContainerType( {typeName: "PendingBalanceDeposit", jsonCase: "eth2"} ); -export const PendingBalanceDeposits = new ListCompositeType( - PendingBalanceDeposit, - Number(PENDING_BALANCE_DEPOSITS_LIMIT) -); +export const PendingBalanceDeposits = new ListCompositeType(PendingBalanceDeposit, PENDING_BALANCE_DEPOSITS_LIMIT); export const PendingPartialWithdrawal = new ContainerType( { @@ -348,9 +345,9 @@ export const BeaconState = new ContainerType( earliestExitEpoch: Epoch, // New in Electra:EIP7251 consolidationBalanceToConsume: Gwei, // New in Electra:EIP7251 earliestConsolidationEpoch: Epoch, // New in Electra:EIP7251 - pendingBalanceDeposits: PendingBalanceDeposits, // new in electra:eip7251 - pendingPartialWithdrawals: new ListCompositeType(PendingPartialWithdrawal, Number(PENDING_PARTIAL_WITHDRAWALS_LIMIT)), // New in Electra:EIP7251 - pendingConsolidations: new ListCompositeType(PendingConsolidation, Number(PENDING_CONSOLIDATIONS_LIMIT)), // new in electra:eip7251 + pendingBalanceDeposits: PendingBalanceDeposits, // New in Electra:EIP7251 + pendingPartialWithdrawals: new ListCompositeType(PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT), // New in Electra:EIP7251 + pendingConsolidations: new ListCompositeType(PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT), // New in Electra:EIP7251 }, {typeName: "BeaconState", jsonCase: "eth2"} );