Genesis block store uses genesis time

Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
This commit is contained in:
Carl Beekhuizen 2019-06-20 20:50:17 +02:00 committed by GitHub
parent d73aa31ef6
commit 5f8edd6b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -82,7 +82,12 @@ class Store(object):
def get_genesis_store(genesis_state: BeaconState) -> Store: def get_genesis_store(genesis_state: BeaconState) -> Store:
genesis_block = BeaconBlock(state_root=hash_tree_root(genesis_state)) genesis_block = BeaconBlock(state_root=hash_tree_root(genesis_state))
root = signing_root(genesis_block) root = signing_root(genesis_block)
return Store(blocks={root: genesis_block}, states={root: genesis_state}, justified_root=root, finalized_root=root) return Store(
blocks={root: genesis_block},
states={root: genesis_state},
time=genesis_state.genesis_time,
justified_root=root, finalized_root=root,
)
``` ```
#### `get_ancestor` #### `get_ancestor`