def test_transfer_history(federation, alice, bob, spool_regtest, spider, registered_edition_two_hashes, rpconn):
    from .conftest import reload_address
    reload_address(alice, rpconn)
    edition_number = 2
    piece_hash = registered_edition_two_hashes[0]
    txid = spool_regtest.transfer(('', alice), bob, registered_edition_two_hashes, b'alice-secret', edition_number, min_confirmations=1)
    rpconn.generate(1)
    history = spider.history(piece_hash)
    assert (len(history) == 3)
    assert ('' in history)
    assert (0 in history)
    assert (edition_number in history)
    assert (len(history['']) == 1)
    assert (len(history[0]) == 1)
    assert (len(history[edition_number]) == 2)
    transfer_data = history[edition_number][1]
    assert (transfer_data['action'] == 'TRANSFER')
    assert (transfer_data['edition_number'] == edition_number)
    assert (transfer_data['from_address'] == alice)
    assert (transfer_data['number_editions'] == 3)
    assert (transfer_data['piece_address'] == piece_hash)
    assert transfer_data['timestamp_utc']
    assert (transfer_data['to_address'] == bob)
    assert (transfer_data['txid'] == txid)
    assert (transfer_data['verb'] == b'ASCRIBESPOOL01TRANSFER2')
def test_transfer_history(federation, alice, bob, spool_regtest, spider, registered_edition_two_hashes, rpconn):
    from .conftest import reload_address
    reload_address(alice, rpconn)
    edition_number = 2
    piece_hash = registered_edition_two_hashes[0]
    txid = spool_regtest.transfer((, alice), bob, registered_edition_two_hashes, b'alice-secret', edition_number, min_confirmations=1)
    rpconn.generate(1)
    history = spider.history(piece_hash)
    assert (len(history) == 3)
    assert ( in history)
    assert (0 in history)
    assert (edition_number in history)
    assert (len(history[]) == 1)
    assert (len(history[0]) == 1)
    assert (len(history[edition_number]) == 2)
    transfer_data = history[edition_number][1]
    assert (transfer_data['action'] == 'TRANSFER')
    assert (transfer_data['edition_number'] == edition_number)
    assert (transfer_data['from_address'] == alice)
    assert (transfer_data['number_editions'] == 3)
    assert (transfer_data['piece_address'] == piece_hash)
    assert transfer_data['timestamp_utc']
    assert (transfer_data['to_address'] == bob)
    assert (transfer_data['txid'] == txid)
    assert (transfer_data['verb'] == b'ASCRIBESPOOL01TRANSFER2')