remove custom timeout as the latest bittrex package version implemented it
This commit is contained in:
parent
f33bc93639
commit
8be94c4af4
@ -15,20 +15,6 @@ _API: _Bittrex = None
|
|||||||
_API_V2: _Bittrex = None
|
_API_V2: _Bittrex = None
|
||||||
_EXCHANGE_CONF: dict = {}
|
_EXCHANGE_CONF: dict = {}
|
||||||
|
|
||||||
# API socket timeout
|
|
||||||
API_TIMEOUT = 60
|
|
||||||
|
|
||||||
|
|
||||||
def custom_requests(request_url, apisign):
|
|
||||||
"""
|
|
||||||
Set timeout for requests
|
|
||||||
"""
|
|
||||||
return requests.get(
|
|
||||||
request_url,
|
|
||||||
headers={"apisign": apisign},
|
|
||||||
timeout=API_TIMEOUT
|
|
||||||
).json()
|
|
||||||
|
|
||||||
|
|
||||||
class Bittrex(Exchange):
|
class Bittrex(Exchange):
|
||||||
"""
|
"""
|
||||||
@ -47,14 +33,12 @@ class Bittrex(Exchange):
|
|||||||
api_secret=_EXCHANGE_CONF['secret'],
|
api_secret=_EXCHANGE_CONF['secret'],
|
||||||
calls_per_second=1,
|
calls_per_second=1,
|
||||||
api_version=API_V1_1,
|
api_version=API_V1_1,
|
||||||
dispatch=custom_requests
|
|
||||||
)
|
)
|
||||||
_API_V2 = _Bittrex(
|
_API_V2 = _Bittrex(
|
||||||
api_key=_EXCHANGE_CONF['key'],
|
api_key=_EXCHANGE_CONF['key'],
|
||||||
api_secret=_EXCHANGE_CONF['secret'],
|
api_secret=_EXCHANGE_CONF['secret'],
|
||||||
calls_per_second=1,
|
calls_per_second=1,
|
||||||
api_version=API_V2_0,
|
api_version=API_V2_0,
|
||||||
dispatch=custom_requests
|
|
||||||
)
|
)
|
||||||
self.cached_ticker = {}
|
self.cached_ticker = {}
|
||||||
|
|
||||||
|
@ -353,8 +353,3 @@ def test_validate_response_min_trade_requirement_not_met():
|
|||||||
}
|
}
|
||||||
with pytest.raises(ContentDecodingError, match=r'.*MIN_TRADE_REQUIREMENT_NOT_MET.*'):
|
with pytest.raises(ContentDecodingError, match=r'.*MIN_TRADE_REQUIREMENT_NOT_MET.*'):
|
||||||
Bittrex._validate_response(response)
|
Bittrex._validate_response(response)
|
||||||
|
|
||||||
|
|
||||||
def test_custom_requests(mocker):
|
|
||||||
mocker.patch('freqtrade.exchange.bittrex.requests', MagicMock())
|
|
||||||
btx.custom_requests('http://', '')
|
|
||||||
|
Loading…
Reference in New Issue
Block a user