Skip to content

Commit

Permalink
Cryptocompare can now be queried for IOTA
Browse files Browse the repository at this point in the history
  • Loading branch information
LefterisJP committed Feb 22, 2019
1 parent 2193dfe commit be028ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rotkehlchen/history.py
Expand Up @@ -252,6 +252,9 @@ def __init__(self, data_directory, history_date_start, inquirer):
# it's not in the coinlist so let's add them here.
self.cryptocompare_coin_list['DAO'] = object()
self.cryptocompare_coin_list['USDT'] = object()
# IOTA is known to cryptocompare as IOT, but add IOTA too since
# we have conversion code to handle it and we accept queries with it
self.cryptocompare_coin_list['IOTA'] = object()

def got_cached_price(self, cache_key, timestamp):
"""Check if we got a price history for the timestamp cached"""
Expand Down
13 changes: 13 additions & 0 deletions rotkehlchen/tests/test_price_history.py
Expand Up @@ -54,3 +54,16 @@ def test_price_queries(price_historian):
# include them in the tests
do_queries_for('BTC', 'EUR', price_historian)
do_queries_for('ETH', 'EUR', price_historian)


@pytest.mark.parametrize('should_mock_price_queries', [False])
def test_cryptocompare_iota_query(price_historian):
"""
Test that IOTA can be properly queried from cryptocompare
Issue: https://github.com/rotkehlchenio/rotkehlchen/issues/299
"""
usd_price = price_historian.query_historical_price('IOTA', 'USD', 1511793374)
assert usd_price.is_close(FVal('0.954'))
usd_price = price_historian.query_historical_price('IOT', 'USD', 1511793374)
assert usd_price.is_close(FVal('0.954'))

0 comments on commit be028ab

Please sign in to comment.