Set genesis_state.latest_block_header with `body_root` of empty BeaconBlockBody (#1098)

This commit is contained in:
Hsiao-Wei Wang 2019-05-20 17:16:20 +08:00 committed by GitHub
parent a6a61bbecb
commit 83123a33da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1189,7 +1189,11 @@ Let `genesis_state = get_genesis_beacon_state(genesis_deposits, eth2genesis.gene
```python ```python
def get_genesis_beacon_state(deposits: List[Deposit], genesis_time: int, genesis_eth1_data: Eth1Data) -> BeaconState: def get_genesis_beacon_state(deposits: List[Deposit], genesis_time: int, genesis_eth1_data: Eth1Data) -> BeaconState:
state = BeaconState(genesis_time=genesis_time, latest_eth1_data=genesis_eth1_data) state = BeaconState(
genesis_time=genesis_time,
latest_eth1_data=genesis_eth1_data,
latest_block_header=BeaconBlockHeader(body_root=hash_tree_root(BeaconBlockBody())),
)
# Process genesis deposits # Process genesis deposits
for deposit in deposits: for deposit in deposits: