Skip to content

Commit

Permalink
Add merge genesis spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Sep 29, 2021
1 parent e503eba commit e09b6ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/beacon-state-transition/src/util/genesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ export function initializeBeaconStateFromEth1(

if (GENESIS_SLOT >= config.MERGE_FORK_EPOCH) {
const stateMerge = state as TreeBacked<merge.BeaconState>;
// as of Sep 2021, this is for spec test only
stateMerge.fork.previousVersion = config.GENESIS_FORK_VERSION;
stateMerge.latestExecutionPayloadHeader.blockHash = eth1BlockHash;
stateMerge.latestExecutionPayloadHeader.timestamp = eth1Timestamp;
stateMerge.latestExecutionPayloadHeader.random = eth1BlockHash;
Expand Down
4 changes: 4 additions & 0 deletions packages/spec-test-runner/test/spec/merge/genesis.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {ForkName} from "@chainsafe/lodestar-params";
import {genesis} from "../allForks/genesis";

genesis(ForkName.merge);

0 comments on commit e09b6ec

Please sign in to comment.