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 Jun 5, 2018
1 parent 70a6775 commit ae1effa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 7 additions & 5 deletions catalyst/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
from catalyst.exchange.utils.exchange_utils import delete_algo_folder
from catalyst.utils.cli import Date, Timestamp
from catalyst.utils.run_algo import _run, load_extensions

from catalyst.constants import SUPPORTED_EXCHANGES
from catalyst.exchange.utils.bundle_utils import EXCHANGE_NAMES

try:
__IPYTHON__
Expand Down Expand Up @@ -587,9 +586,12 @@ 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))
if exchange_name not in EXCHANGE_NAMES:
ctx.fail(
"ingest-exchange does not support {}, "
"please choose exchange from: {}".format(
exchange_name,
EXCHANGE_NAMES))

exchange_bundle = ExchangeBundle(exchange_name)

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

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

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

0 comments on commit ae1effa

Please sign in to comment.