Exemplo n.º 1
0
def genesis_block(genesis_active_state, genesis_crystallized_state):
    active_state_root = genesis_active_state.hash
    crystallized_state_root = genesis_crystallized_state.hash

    return get_genesis_block(
        active_state_root=active_state_root,
        crystallized_state_root=crystallized_state_root,
    )
Exemplo n.º 2
0
def test_get_genesis_block(genesis_active_state, genesis_crystallized_state):
    active_state_root = genesis_active_state.hash
    crystallized_state_root = genesis_crystallized_state.hash

    block = get_genesis_block(
        active_state_root=active_state_root,
        crystallized_state_root=crystallized_state_root,
    )

    assert block.parent_hash == ZERO_HASH32
    assert block.slot_number == 0
    assert block.randao_reveal == ZERO_HASH32
    assert block.num_attestations == 0
    assert block.pow_chain_ref == ZERO_HASH32
    assert block.active_state_root == active_state_root
    assert block.crystallized_state_root == crystallized_state_root