mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
Improve error message, add test for trade_pagination_id validation
This commit is contained in:
@@ -182,5 +182,5 @@ class Kraken(Exchange):
|
|||||||
# If the id is smaller than 19 characters, it's not a valid timestamp.
|
# If the id is smaller than 19 characters, it's not a valid timestamp.
|
||||||
if len(from_id) >= 19:
|
if len(from_id) >= 19:
|
||||||
return True
|
return True
|
||||||
logger.debug("trade-pagination id is not valid. Fallback to timestamp.")
|
logger.debug(f"{pair} - trade-pagination id is not valid. Fallback to timestamp.")
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -271,3 +271,14 @@ def test_stoploss_adjust_kraken(mocker, default_conf, sl1, sl2, sl3, side):
|
|||||||
# diff. order type ...
|
# diff. order type ...
|
||||||
order['type'] = 'limit'
|
order['type'] = 'limit'
|
||||||
assert exchange.stoploss_adjust(sl3, order, side=side)
|
assert exchange.stoploss_adjust(sl3, order, side=side)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('trade_id, expected', [
|
||||||
|
('1234', False),
|
||||||
|
('170544369512007228', False),
|
||||||
|
('1705443695120072285', True),
|
||||||
|
('170544369512007228555', True),
|
||||||
|
])
|
||||||
|
def test__valid_trade_pagination_id_kraken(mocker, default_conf_usdt, trade_id, expected):
|
||||||
|
exchange = get_patched_exchange(mocker, default_conf_usdt, id='kraken')
|
||||||
|
assert exchange._valid_trade_pagination_id('XRP/USDT', trade_id) == expected
|
||||||
|
|||||||
Reference in New Issue
Block a user