Remove Bittrex and Interface classes

This commit is contained in:
enenn
2018-03-23 23:38:54 +01:00
parent 800c327b12
commit a5f5987450
7 changed files with 15 additions and 409 deletions

View File

@@ -17,7 +17,6 @@ import requests
from sqlalchemy import create_engine
from freqtrade import DependencyException, OperationalException
from freqtrade.exchange import Exchanges
from freqtrade.freqtradebot import FreqtradeBot
from freqtrade.persistence import Trade
from freqtrade.state import State
@@ -261,7 +260,7 @@ def test_create_trade(default_conf, ticker, limit_buy_order, mocker) -> None:
assert trade.stake_amount == 0.001
assert trade.is_open
assert trade.open_date is not None
assert trade.exchange == Exchanges.BITTREX.name
assert trade.exchange == 'bittrex'
# Simulate fulfilled LIMIT_BUY order for trade
trade.update(limit_buy_order)
@@ -423,7 +422,7 @@ def test_process_trade_creation(default_conf, ticker, limit_buy_order,
assert trade.stake_amount == default_conf['stake_amount']
assert trade.is_open
assert trade.open_date is not None
assert trade.exchange == Exchanges.BITTREX.name
assert trade.exchange == 'bittrex'
assert trade.open_rate == 0.00001099
assert trade.amount == 90.99181073703367

View File

@@ -4,7 +4,6 @@ import os
import pytest
from sqlalchemy import create_engine
from freqtrade.exchange import Exchanges
from freqtrade.persistence import Trade, init, clean_dry_run_db
@@ -122,7 +121,7 @@ def test_update_with_bittrex(limit_buy_order, limit_sell_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
assert trade.open_order_id is None
assert trade.open_rate is None
@@ -149,7 +148,7 @@ def test_calc_open_close_trade_price(limit_buy_order, limit_sell_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
trade.open_order_id = 'something'
@@ -171,7 +170,7 @@ def test_calc_close_trade_price_exception(limit_buy_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
trade.open_order_id = 'something'
@@ -184,7 +183,7 @@ def test_update_open_order(limit_buy_order):
pair='BTC_ETH',
stake_amount=1.00,
fee=0.1,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
assert trade.open_order_id is None
@@ -206,7 +205,7 @@ def test_update_invalid_order(limit_buy_order):
pair='BTC_ETH',
stake_amount=1.00,
fee=0.1,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
limit_buy_order['type'] = 'invalid'
with pytest.raises(ValueError, match=r'Unknown order type'):
@@ -218,7 +217,7 @@ def test_calc_open_trade_price(limit_buy_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
trade.open_order_id = 'open_trade'
trade.update(limit_buy_order) # Buy @ 0.00001099
@@ -235,7 +234,7 @@ def test_calc_close_trade_price(limit_buy_order, limit_sell_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
trade.open_order_id = 'close_trade'
trade.update(limit_buy_order) # Buy @ 0.00001099
@@ -256,7 +255,7 @@ def test_calc_profit(limit_buy_order, limit_sell_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
trade.open_order_id = 'profit_percent'
trade.update(limit_buy_order) # Buy @ 0.00001099
@@ -286,7 +285,7 @@ def test_calc_profit_percent(limit_buy_order, limit_sell_order):
pair='BTC_ETH',
stake_amount=0.001,
fee=0.0025,
exchange=Exchanges.BITTREX,
exchange='bittrex',
)
trade.open_order_id = 'profit_percent'
trade.update(limit_buy_order) # Buy @ 0.00001099

View File

@@ -6,7 +6,7 @@ import sys
from freqtrade import exchange
from freqtrade import misc
from freqtrade.exchange import Bittrex
from freqtrade.exchange import ccxt
parser = misc.common_args_parser('download utility')
parser.add_argument(
@@ -28,7 +28,7 @@ PAIRS = list(set(PAIRS))
print('About to download pairs:', PAIRS)
# Init Bittrex exchange
exchange._API = Bittrex({'key': '', 'secret': ''})
exchange._API = ccxt.bittrex({'key': '', 'secret': ''})
for pair in PAIRS:
for tick_interval in TICKER_INTERVALS: