Exemplo n.º 1
0
def test_api_get_genesis_block():
    node_status = EPOCH_CLI.get_status()
    genesis_block = EPOCH_CLI.get_key_block_by_hash(
        hash=node_status.genesis_key_block_hash)
    zero_height_block = EPOCH_CLI.get_key_block_by_height(
        height=0)  # these should be equivalent
    # assert type(genesis_block) == BlockWithTx
    # assert type(zero_height_block) == BlockWithTx
    assert genesis_block.height == genesis_block.height == 0
    # TODO: The following check should not fail. I feel that's a problem with
    # TODO: the current state of the api  --devsnd
    assert genesis_block.hash == zero_height_block.hash
Exemplo n.º 2
0
def test_api_get_block_by_height():
    height = EPOCH_CLI.get_current_key_block_height()

    block = EPOCH_CLI.get_key_block_by_height(height=height)
    # assert type(block) == BlockWithTx
    assert block.height > 0