def test_chain(loaned_edition_two_hashes, spider):
    from spool import BlockchainSpider
    history = spider.history(loaned_edition_two_hashes[0])
    chain = BlockchainSpider.chain(history, 2)
    assert (len(chain) == 3)
    assert (chain[0]['action'] == 'REGISTER')
    assert (chain[1]['action'] == 'TRANSFER')
    assert (chain[2]['action'] == 'LOAN')
    assert (chain[0]['edition_number'] == 2)
    assert (chain[1]['edition_number'] == 2)
    assert (chain[2]['edition_number'] == 2)
def test_chain(loaned_edition_two_hashes, spider):
    from spool import BlockchainSpider
    history = spider.history(loaned_edition_two_hashes[0])
    chain = BlockchainSpider.chain(history, 2)
    assert (len(chain) == 3)
    assert (chain[0]['action'] == 'REGISTER')
    assert (chain[1]['action'] == 'TRANSFER')
    assert (chain[2]['action'] == 'LOAN')
    assert (chain[0]['edition_number'] == 2)
    assert (chain[1]['edition_number'] == 2)
    assert (chain[2]['edition_number'] == 2)