Skip to content

Commit 128bc8f

Browse files
marioevzspencer-tb
authored andcommitted
tools/spec: Fix beacon root on genesis
1 parent b82632e commit 128bc8f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/ethereum_test_tools/spec/blockchain_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def make_genesis(
9494
if env.withdrawals is not None
9595
else None
9696
),
97+
beacon_root=Hash.or_none(env.beacon_root),
9798
)
9899

99100
genesis_rlp, genesis.hash = genesis.build(

src/ethereum_test_tools/spec/state_test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
State test filler.
33
"""
4+
from copy import copy
45
from dataclasses import dataclass
56
from typing import Any, Callable, Dict, Generator, List, Mapping, Optional, Tuple, Type
67

@@ -57,7 +58,13 @@ def make_genesis(
5758
"""
5859
Create a genesis block from the state test definition.
5960
"""
60-
env = self.env.set_fork_requirements(fork)
61+
env = copy(self.env)
62+
63+
# Remove fields that should not be present in the genesis block.
64+
env.withdrawals = None
65+
env.beacon_root = None
66+
67+
env = env.set_fork_requirements(fork)
6168

6269
genesis = FixtureHeader(
6370
parent_hash=Hash(0),
@@ -93,6 +100,7 @@ def make_genesis(
93100
if env.withdrawals is not None
94101
else None
95102
),
103+
beacon_root=Hash.or_none(env.beacon_root),
96104
)
97105

98106
genesis_rlp, genesis.hash = genesis.build(

0 commit comments

Comments
 (0)