Skip to content

Commit

Permalink
ENH: Raise error when trying to ingest data of exchange that is not s…
Browse files Browse the repository at this point in the history
…upported - issue scrtlabs#341
  • Loading branch information
EmbarAlmog committed May 31, 2018
1 parent 25aec41 commit d12fefb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions catalyst/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from catalyst.utils.cli import Date, Timestamp
from catalyst.utils.run_algo import _run, load_extensions

from catalyst.constants import SUPPORTED_EXCHANGES

try:
__IPYTHON__
except NameError:
Expand Down Expand Up @@ -585,6 +587,9 @@ def ingest_exchange(ctx, exchange_name, data_frequency, start, end,

if exchange_name is None:
ctx.fail("must specify an exchange name '-x'")
if exchange_name not in SUPPORTED_EXCHANGES:
ctx.fail("ingest-exchange does not support {}, please choose exchange from: {}".format(exchange_name,
SUPPORTED_EXCHANGES))

exchange_bundle = ExchangeBundle(exchange_name)

Expand Down
2 changes: 2 additions & 0 deletions catalyst/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@

SUPPORTED_WALLETS = ['metamask', 'ledger', 'trezor', 'bitbox', 'keystore',
'key']

SUPPORTED_EXCHANGES = ['bitfinex', 'poloniex', 'bittrex']

0 comments on commit d12fefb

Please sign in to comment.