def test_api_get_block_by_hash(): client = EpochClient() latest_block = client.get_latest_block() block = client.get_block_by_hash(latest_block.hash) # TODO: The following check should not fail. I feel that's a problem with # TODO: the current state of the api --devsnd # assert block.hash == latest_block.hash assert block.height == latest_block.height
def test_api_get_block_transaction_count_by_hash(): client = EpochClient() # get the latest block block = client.get_latest_block() print(block) assert block.hash is not None # get the transaction count that should be a number >= 0 txs_count = client.get_block_transaction_count_by_hash(block.hash) print(txs_count) assert txs_count.count >= 0
def test_api_get_latest_block(): client = EpochClient() block = client.get_latest_block() # assert type(block) == BlockWithTx assert block.height > 0